home *** CD-ROM | disk | FTP | other *** search
/ Family Forum 261 / SOMC Family Forum 261.iso / WIN32 / SETUP.RUL < prev    next >
Text File  |  1996-08-07  |  99KB  |  2,811 lines

  1. /*----------------------------------------------------------------------------*\
  2.  *
  3.  * Installer for    : Generic 32-bit installer
  4.  * 
  5.  * Template by        : Marty Euerle
  6.  * Modified by        : Barry Mansur
  7.  * Modified on        : 02/01/96
  8.  *    Modified by        : Martin Euerle
  9.  *                on        : 7/29/96
  10.  *
  11.  * NOTES            : This is the Generic 16-Bit InstallShield 3 installer script.  
  12.  *                          : It does NOT check the operatingsystem.
  13.  *           
  14.  * REVISIONS:     02-16-96       Removed the Product.PF & Personnalize floppy sections.
  15.  *                                     Added support for uncompressed files.
  16.  *                      03-01-96       Added flags for executing QuickTime installer &
  17.  *                                     asking a user questions with answers written to text file.
  18.  *                    07-29-96        Major rewrite, modified the setup.rul file to read all
  19.  *                                    neccessary information from the setup.ini file.    
  20.  *
  21.  *
  22. \*----------------------------------------------------------------------------*/
  23.  
  24.  
  25. // LAUNCH QUICKTIME INSTALLER
  26. #define LAUNCH_QT                0                // 1 - Launches QuickTime Installer at end of Install
  27.  
  28. // Do not change the defines listed below
  29. //#define PROGRAM_GROUP_NAME  "MECC"
  30. //#define COMPANY_NAME        "MECC"
  31. #define BASE_REGISTRYNT         "Software\\Microsoft\\Windows NT\\CurrentVersion\\App Paths\\"
  32. #define BASE_REGISTRY95         "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\"  
  33. //#define STR_COMPLETE95        "by selecting the program icon in the Programs menu.\n\n"
  34. //#define STR_COMPLETENT        "by selecting the program icon in the program group.\n\n"
  35.  
  36. declare
  37.    #include "sddialog.h"  
  38.    // Global variables loaded from the setup.ini file.  
  39.    
  40.        //PRODUCT NAME & EXECUTABLES
  41.         STRING    g_strPRODUCT_NAME;        
  42.         STRING    g_strPRODUCT_VERSION;     
  43.         STRING    g_strAPPLICATION_NAME32;      
  44.         STRING    g_strUNINSTALL_KEY;             // unique identifier, (name)(media)(version)   
  45.         
  46.         //SETUP SCREEN DEFINITION
  47.       STRING    g_strSETUP_DESCRIPTION;       // Displays the Product name +  SETUP_DESCRIPTION on the background
  48.       NUMBER    g_numSETUP_FONT_SIZE;        // Define the font size
  49.       STRING    g_strSETUP_COLOR;             // Define the color    
  50.       
  51.       //SYSTEM CHECKS
  52.         NUMBER    g_numREQ_MIN_COLORS;            // minimum number of colors for color check
  53.         NUMBER    g_numREQ_MIN_CPU;                // minimum CPU product will run with
  54.                                            
  55.         // MULTIPLE INSTALL INFO                                            
  56.         NUMBER    g_numMULTIPLE_INSTALL;        // 0 - one install choice, 1 - multiple
  57.         NUMBER    g_numSIZE_REQ_OPTION_1;        // HD Space Required for First or Only Install Option
  58.         NUMBER    g_numSIZE_REQ_OPTION_2;        // HD Space Required for Second Install Option
  59.         NUMBER    g_numSIZE_REQ_OPTION_3;        // HD Space Required for Third Install Option   
  60.         
  61.         // MEDIA & FILE TYPES
  62.         NUMBER    g_numCD_ROM;                     // 1 - CDROM therefore if Win95, launch Autorun
  63.         NUMBER    g_numCOPY_UNCOMP;                // 1 - Copy Uncompressed Files
  64.         NUMBER    g_numCOPY_COMP;                // 1 - Copy Compressed Files        
  65.         
  66.         // APPLICATION PATHS
  67.         STRING    g_strAPPBASE_PATH_95; 
  68.         STRING    g_strAPPBASE_PATH_NT3x;
  69.         STRING    g_strAPPBASE_PATH_NT40;     //    "Program Files\\MECC\\Oregon Trail II\\"
  70.         
  71.         //g_strAPPBASE_PATH_NT3x    "MECC\\OTII\\"    
  72.         
  73.       // REGISTRY INFO
  74.         NUMBER    g_numEXTENSION_USED;            // 0 - no saved game, 1 - saved game
  75.         STRING    g_strEXTENSION;                // indicates saved game extension Example: afr    
  76.          
  77.         //GENERAL PRODUCT DEFINITIONS
  78.         STRING    g_strPROGRAM_GROUP_NAME;    //ex:      "MECC"
  79.         STRING    g_strCOMPANY_NAME;            //ex:      "MECC"
  80.         STRING    g_strBASE_REGISTRYNT;        //ex:      "Software\\Microsoft\\Windows NT\\CurrentVersion\\App Paths\\"
  81.         STRING    g_strBASE_REGISTRY95;        //ex:      "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\"  
  82.         STRING    g_strSTR_COMPLETE95;            //ex:        "by selecting the program icon in the Programs menu.\n\n"
  83.         STRING    g_strSTR_COMPLETENT;            //ex:        "by selecting the program icon in the program group.\n\n"                
  84.         NUMBER    g_numMAX_LINES_INI; 
  85.         
  86.         
  87.         //MESSAGE STRINGS
  88.         //SS    - SetupScreen
  89.         STRING    g_strSS_SetTitle; 
  90.         
  91.         //CFTL -    CompressedFileTransferList
  92.         STRING    g_strCFTL_SetStatusWindowMsg;
  93.         
  94.         //MIO - Multiple_Installation_Options_
  95.         STRING    g_strMIO_SetupType;    
  96.         STRING    g_strMIO_SetDialogTitle;
  97.         STRING    g_strMIO_AskOptionsMessage;
  98.         STRING    g_strMIO_AskOptionsDescription1;
  99.         STRING    g_strMIO_AskOptionsDescription2;
  100.         STRING    g_strMIO_AskOptionsDescription3;
  101.         
  102.         //CR -    CheckRequirements                                        
  103.         STRING    g_strCR_ColorMsg1;
  104.         STRING    g_strCR_ColorMsg2;
  105.         STRING    g_strCR_CPUMsg1;                
  106.         STRING    g_strCR_CPUMsg2;
  107.         STRING    g_strCR_ScreenResolution;        
  108.  
  109.         //SI - SystemInfo
  110.         STRING    g_strSI_Title;
  111.         STRING    g_strSI_Msg;
  112.         STRING    g_strSI_System;
  113.         STRING    g_strSI_CPU;
  114.         STRING    g_strSI_MEM;
  115.         STRING    g_strSI_BASEMEM;
  116.         STRING    g_strSI_EXTENDEDMEM;
  117.         STRING    g_strSI_VIDEO;
  118.         STRING    g_strSI_COLORS
  119.         STRING    g_strSI_Resolution;
  120.         STRING    g_strSI_Unknown;
  121.         STRING    g_strSI_Beyond;
  122.         STRING    g_strSI_VideoDrTypMsg;
  123.         STRING    g_strSI_VideoTypMsg;        
  124.         STRING    g_strSI_MidiDrTypMsg;
  125.         STRING    g_strSI_MULTIMEDMSG;
  126.         STRING    g_strSI_Detected;
  127.         STRING    g_strSI_NotDetected;
  128.         STRING    g_strSI_Avi;
  129.         STRING    g_strSI_QTW;
  130.         STRING    g_strSI_Wave;
  131.         STRING    g_strSI_DriveInfo;
  132.         STRING    g_strSI_CDROM;
  133.         STRING    g_strSI_DrTypeFixed;
  134.         STRING    g_strSI_DrTypeRemov;
  135.         STRING    g_strSI_DrTypeRemote;
  136.         STRING    g_strSI_FreeSpace;
  137.         STRING    g_strSI_MB;
  138.  
  139.    // Global variable declarations.
  140.    NUMBER  nvDiskLocked;
  141.    NUMBER  OS32_16;
  142.    STRING  szApplicationName;
  143.    STRING  svByte;
  144.    NUMBER  nvByte;
  145.    STRING  szProductName;
  146.    STRING  svUserDestDrive;     // User chosen installation drive
  147.  
  148.    STRING      svGrp, szMsg, szFileSet, szTitle;
  149.    STRING      szProgram, szTemp, svUninstLogFile, szRegKey;
  150.    STRING      svMainDirectory[ _MAX_STRING ];
  151.    BOOL        bSpaceOk, bReshowSetupType;
  152.    NUMBER      nResult, nType; // nvCONTINUE, nvMyReturn, nStatusId;
  153.  
  154.    // BOOL values for install program file sizes
  155.    BOOL        bInclude_Copyset1, bInclude_Copyset2, bInclude_Copyset3;
  156.    BOOL         bTypical, bCompact, bCostum;
  157.    BOOL         bCustom1, bCustom2, bCustom3;
  158.  
  159.    NUMBER      nvStrLen;
  160.    STRING      svTempStr;
  161.     
  162.    //OS variables
  163.    NUMBER    nvResult, nvQuitInstaller, nvOS32_16;
  164.    STRING      svResult;
  165.    BOOL        bWin3x, bWinNT3x, bWinNT40, bWin95;
  166.    STRING      APPBASE_PATH;
  167.         
  168.    //File Info variable
  169.    STRING    szFile, szSourceFile, szTargetFile;
  170.  
  171.    //SystemInfo variables
  172.    STRING    szInfo, svReturn;
  173.    NUMBER    nvReturn, nvRETURN;
  174.    LIST        ListInfo;
  175.           
  176.    //temp values
  177.    STRING     szSourceDir, szTargetDir; 
  178.  
  179.    // variables changed for GetUserInfo
  180.    STRING svUserStr1, svUserStr2;
  181.    NUMBER nvPersonalize;
  182.    
  183.    // variable for OpenSetupFile()
  184.    NUMBER   nglobalFileHandle;
  185.    STRING   svglobalFilePath;
  186.    STRING    svglobalFileName;
  187.    STRING   svglobalReturnStr;
  188.    STRING    svglobalLineStr;
  189.  
  190.    // Function declarations.
  191.    
  192.    // *** EDIT THESE FUNCTIONS FOR EACH NEW INSTALLER ***
  193.    prototype WriteTextFile();  // ie. .ini file
  194.    prototype MakeIcons();
  195.  
  196.    // *** THESE FUNCTIONS MAY NEED TO BE EDITED ***
  197.    prototype CreateRegDBEntries();
  198.    prototype CopyFiles();
  199.    prototype CompressedFileTransferList();
  200.    prototype Single_Installation_Option();
  201.    prototype Multiple_Installation_Options();
  202.  
  203.    // These functions need no modifications
  204.    prototype CheckSpaceRequirements( number, number, number, string );
  205.    prototype DetermineOS();
  206.    prototype SetupScreen();
  207.    prototype SystemInfo();
  208.    prototype CheckRequirements();
  209.    prototype InstallReview(); 
  210.    
  211.    
  212.    prototype Load_App_Info();
  213.    prototype Launch_ThirdPartyInstallers();
  214.    prototype Additional_Registry_Info();
  215.    prototype Load_Message_Strings();
  216.    
  217.    prototype     OpenSetupFile();
  218.    prototype     CloseSetupFile();
  219.    prototype   FindLine( string, string, string );
  220.    prototype    GetNextLine( string, string );
  221.     prototype    GetCurrentLine( string, string );   
  222.    
  223.  
  224.    STRING     svPath; //, svLine1, svLine2;
  225.    
  226. // ----------------------MAIN PROGRAM--------------------------- 
  227. program
  228.  
  229. StartHere: 
  230. // ----------------------------------------------------------------
  231.  
  232.    Disable( BACKGROUND );
  233.  
  234.    // Set up the installation screen.
  235.    g_numMAX_LINES_INI = 10;        // this value will change once the Setup.ini file is loaded.   
  236.    
  237.    Load_App_Info();
  238.    Load_Message_Strings();   
  239.    DetermineOS();   
  240.    SetupScreen();  
  241. //   Load_Message_Strings();
  242.  
  243.  
  244.    // Test target system proper configuration.
  245.    CheckRequirements();
  246.  
  247.    // Set installation info., which is required for registry entries.
  248.    InstallationInfo( g_strCOMPANY_NAME, g_strPRODUCT_NAME, g_strPRODUCT_VERSION, szApplicationName );
  249.  
  250.    // Notify user of rights.
  251.    Disable(BACKBUTTON);
  252.    if(SdLicense("Software License Agreement", "Know Your Rights (and respect ours, too)",
  253.                 "Do you accept all the terms of the preceding license agreement? If so, click on the Yes push button. If you select No, Setup will close.",
  254.               "license.txt") = YES) then
  255.  
  256.    else
  257.       goto quit;
  258.    endif;
  259.    Enable(BACKBUTTON);
  260.  
  261.    InstallReview();
  262.  
  263. WelcomeDlg:
  264. // Create a Welcome dialog.
  265. // ----------------------------------------------------------------
  266.    Disable( BACKBUTTON );
  267.    Welcome( "Welcome", 0 );
  268.    Enable( BACKBUTTON );
  269.  
  270. GetTargetDirectory:
  271. // Ask user for a destination location for the installation.
  272. // ----------------------------------------------------------------
  273.    svMainDirectory = TARGETDISK ^ APPBASE_PATH; 
  274.  
  275.    szMsg = "";  //Default message displayed
  276.  
  277.    Disable( BACKBUTTON );
  278.    AskDestPath( "Choose Destination Location", szMsg, svMainDirectory, 0 );
  279.    Enable( BACKBUTTON );
  280.  
  281.    nvStrLen = StrLength(svMainDirectory);
  282.    StrSub(svTempStr, svMainDirectory, nvStrLen - 1, 1);         
  283.  
  284.    if( StrCompare(svTempStr, "\\") ) then
  285.       svMainDirectory = svMainDirectory + "\\";
  286.    endif; 
  287.    
  288.    //Parse svUserDestDrive;
  289.    StrSub(svUserDestDrive, svMainDirectory, 0, 2);
  290.              
  291.    nType = TYPICAL;
  292.                         
  293.                         
  294. DetermineUserSelection: 
  295. // ----------------------------------------------------------------
  296. // Determine User Selection & Check Hard Drive Space
  297. // ----------------------------------------------------------------
  298.    if(g_numMULTIPLE_INSTALL) then
  299.       Multiple_Installation_Options();
  300.  
  301.       if(nvRETURN = 1) then
  302.          goto GetTargetDirectory;
  303.       elseif(nvRETURN = 2) then
  304.          goto DetermineUserSelection;
  305.       endif;
  306.    else
  307.       Single_Installation_Option();
  308.  
  309.       if(bSpaceOk = FALSE) then 
  310.          goto GetTargetDirectory; 
  311.       endif;
  312.    endif;                                              
  313.  
  314. FolderSelection:
  315. // ---------------------------------------------------------------- 
  316.    svGrp = g_strPROGRAM_GROUP_NAME;
  317.  
  318.    // Allow user to modify folder name.
  319.  
  320.    if(g_numMULTIPLE_INSTALL) then
  321.       if ( SelectFolder( "Folder Selection", svGrp, svGrp ) = BACK ) then
  322.          goto DetermineUserSelection;
  323.       endif;
  324.    else    // Single install
  325.       if ( SelectFolder( "Folder Selection", svGrp, svGrp ) = BACK ) then
  326.          goto GetTargetDirectory;
  327.       endif;
  328.    endif;
  329.  
  330. DoFileTransfer:
  331. // ----------------------------------------------------------------
  332.  
  333.    // Prepare InstallSHIELD to record deinstallation information.
  334.    if(bWin95 || bWinNT3x) then 
  335.       DeinstallStart( svMainDirectory, svUninstLogFile, g_strUNINSTALL_KEY, 0 );
  336.       RegDBSetItem( REGDB_UNINSTALL_NAME, g_strPRODUCT_NAME );
  337.    endif;
  338.  
  339.    // copy compressed program files to user specified location.
  340.    if(g_numCOPY_COMP = 1) then
  341.            CompressedFileTransferList();
  342.    endif;
  343.  
  344.    // copy uncompressed program files to user specified location.
  345.    if(g_numCOPY_UNCOMP = 1) then
  346.            DetermineOS();
  347.            
  348.            
  349.            CopyFiles();  
  350.    endif; 
  351.    
  352.    // Set up progress indicator and information gauge.
  353.    Enable( STATUSDLG );
  354.  
  355. // SetRegistryEntries:
  356. // ----------------------------------------------------------------
  357.    MakeIcons();
  358.    
  359.    /* ==============Write text file======================================================= */
  360.     WriteTextFile();
  361.  
  362.    /* ==============Add any additional registry info====================================== */
  363.     Additional_Registry_Info();
  364.  
  365.    SetStatusWindow( 100, "Installation complete." );
  366.  
  367.    // If shared files could not be installed, then users must restart system.
  368.    if (BATCH_INSTALL = TRUE) then
  369.       szMsg = "Some files could not be installed because they are "+
  370.               "currently in use by other programs in the system.  "+
  371.               "To allow for proper operation of the new program you should restart"+
  372.               "your system at this time.";
  373.       CommitSharedFiles(0);
  374.       RebootDialog( "Restart Windows", szMsg, SYS_BOOTMACHINE );
  375.    else
  376.       szMsg = "Setup is complete.  You may run the installed program ";
  377.       if (bWinNT3x) then
  378.          szMsg = szMsg + g_strSTR_COMPLETENT;
  379.       else
  380.          szMsg = szMsg + g_strSTR_COMPLETE95;
  381.       endif;
  382.  
  383.       MessageBeep( 0 );
  384.       //MessageBox( szMsg, INFORMATION );
  385.    endif;
  386.  
  387.    if(bWin95||bWinNT3x) then
  388.       CreateRegDBEntries();
  389.       //Delay(2);
  390.       Disable( FEEDBACK_FULL );
  391.       Disable( STATUSDLG );
  392.    endif;
  393.    
  394.    
  395.     /* ==============Launch Third Party Installation Programs=============================== */ 
  396.       Launch_ThirdPartyInstallers();
  397.    
  398.    quit:
  399. //   MessageBox( "Installation Complete", INFORMATION );
  400. exit;
  401.  
  402.   // ------------------ END MAIN PROGRAM - Subroutines listed bellow-------- 
  403.  
  404.   #include "sddialog.rul"
  405.  
  406.  
  407. /*---------------------------------------------------------------------------*\
  408.  *
  409.  * Function:  SetupScreen
  410.  *
  411.  *  Purpose:  This function will set up the screen look.  This includes
  412.  *            colors, fonts, text to be displayed, etc.
  413.  *
  414.  *
  415.  * Comments:
  416. \*---------------------------------------------------------------------------*/
  417.  
  418. function SetupScreen()
  419.    begin                                      
  420.                                
  421.       Enable( INDVFILESTATUS ); 
  422.             
  423.       if(g_strSETUP_COLOR = "WHITE") then
  424.          SetTitle( g_strPRODUCT_NAME + " " + g_strSS_SetTitle, g_numSETUP_FONT_SIZE, WHITE );  
  425.        elseif(g_strSETUP_COLOR = "YELLOW") then
  426.          SetTitle( g_strPRODUCT_NAME +" " + g_strSS_SetTitle, g_numSETUP_FONT_SIZE, YELLOW );
  427.        elseif(g_strSETUP_COLOR = "MAGENTA") then
  428.          SetTitle( g_strPRODUCT_NAME +" " + g_strSS_SetTitle, g_numSETUP_FONT_SIZE, MAGENTA );
  429.        elseif(g_strSETUP_COLOR = "BLUE") then
  430.          SetTitle( g_strPRODUCT_NAME +" " + g_strSS_SetTitle, g_numSETUP_FONT_SIZE, BLUE );
  431.        elseif(g_strSETUP_COLOR = "GREEN") then
  432.          SetTitle( g_strPRODUCT_NAME +" " + g_strSS_SetTitle, g_numSETUP_FONT_SIZE, GREEN );
  433.        elseif(g_strSETUP_COLOR = "RED") then
  434.          SetTitle( g_strPRODUCT_NAME +" " + g_strSS_SetTitle, g_numSETUP_FONT_SIZE, RED );                                    
  435.        endif;
  436.  
  437.       Enable( BACKGROUND );
  438.  
  439.    end;  
  440.    
  441.    
  442.  
  443.  
  444.  
  445. /*---------------------------------------------------------------------------*\
  446.  *
  447.  * Function:  Load_App_Info
  448.  *
  449.  *  Purpose:  This function will load the information placed in the setup.ini file.
  450.  *
  451.  *
  452.  * Comments:
  453. \*---------------------------------------------------------------------------*/
  454.  
  455. function Load_App_Info()  
  456.  
  457.    begin
  458.        OpenSetupFile();
  459.       // *************************** [SETUP.INI INFO] ****************************************
  460.       FindLine("[", "]", "SETUP.INI INFO");
  461.       GetNextLine( "<", ">" );
  462.       StrToNum(g_numMAX_LINES_INI, svglobalReturnStr);
  463.                                               //MessageBox("load ini g_numMAX_LINES_INI: " + svglobalReturnStr, INFORMATION);   
  464.  
  465.       // *************************** [PRODUCT NAME & EXECUTABLES] ****************************
  466.         FindLine("[", "]", "PRODUCT NAME & EXECUTABLES");
  467.         GetNextLine( "<", ">" );
  468.       g_strPRODUCT_NAME = svglobalReturnStr;
  469.                                               //MessageBox("load ini g_strPRODUCT_NAME: " + g_strPRODUCT_NAME, INFORMATION);
  470.         GetNextLine( "<", ">" );
  471.       g_strPRODUCT_VERSION = svglobalReturnStr;
  472.                                               //MessageBox("load ini g_strPRODUCT_VERSION: " + g_strPRODUCT_VERSION, INFORMATION);
  473.         GetNextLine( "<", ">" );
  474.       g_strAPPLICATION_NAME32 = svglobalReturnStr;
  475.                                               //MessageBox("load ini g_strAPPLICATION_NAME32: " + g_strAPPLICATION_NAME32, INFORMATION);
  476.         GetNextLine( "<", ">" );
  477.       g_strUNINSTALL_KEY = svglobalReturnStr;
  478.                                               //MessageBox("load ini g_strUNINSTALL_KEY: " + g_strUNINSTALL_KEY, INFORMATION);                     
  479.  
  480.                            
  481.       // *************************** [SETUP SCREEN DEFINITION] *******************************
  482.         FindLine("[", "]", "SETUP SCREEN DEFINITION");
  483.         GetNextLine( "<", ">" );
  484.       g_strSETUP_DESCRIPTION = svglobalReturnStr;
  485.                                               //MessageBox("load ini g_strSETUP_DESCRIPTION: " + g_strSETUP_DESCRIPTION, INFORMATION);
  486.         GetNextLine( "<", ">" );
  487.         StrToNum(g_numSETUP_FONT_SIZE, svglobalReturnStr);
  488.                                               //MessageBox("load ini g_numSETUP_FONT_SIZE: " + svglobalReturnStr, INFORMATION);
  489.         GetNextLine( "<", ">" );
  490.       g_strSETUP_COLOR = svglobalReturnStr;
  491.                                               //MessageBox("load ini g_strSETUP_COLOR: " + g_strSETUP_COLOR, INFORMATION);
  492.  
  493.  
  494.       // *************************** [SYSTEM CHECKS] *****************************************
  495.         FindLine("[", "]", "SYSTEM CHECKS");
  496.         GetNextLine( "<", ">" );
  497.         StrToNum(g_numREQ_MIN_COLORS, svglobalReturnStr);
  498.                                               //MessageBox("load ini g_numREQ_MIN_COLORS: " + svglobalReturnStr, INFORMATION);
  499.         GetNextLine( "<", ">" );
  500.         StrToNum(g_numREQ_MIN_CPU, svglobalReturnStr);
  501.                                               //MessageBox("load ini g_numREQ_MIN_CPU: " + svglobalReturnStr, INFORMATION);
  502.  
  503.  
  504.       // *************************** [MULTIPLE INSTALL INFO] *********************************
  505.         FindLine("[", "]", "MULTIPLE INSTALL INFO");
  506.         GetNextLine( "<", ">" );
  507.         StrToNum(g_numMULTIPLE_INSTALL, svglobalReturnStr);
  508.                                               //MessageBox("load ini g_numMULTIPLE_INSTALL: " + svglobalReturnStr, INFORMATION);
  509.         GetNextLine( "<", ">" );
  510.         StrToNum(g_numSIZE_REQ_OPTION_1, svglobalReturnStr);
  511.                                               //MessageBox("load ini g_numSIZE_REQ_OPTION_1: " + svglobalReturnStr, INFORMATION);
  512.         GetNextLine( "<", ">" );
  513.         StrToNum(g_numSIZE_REQ_OPTION_2, svglobalReturnStr);
  514.                                               //MessageBox("load ini g_numSIZE_REQ_OPTION_2: " + svglobalReturnStr, INFORMATION);
  515.         GetNextLine( "<", ">" );
  516.         StrToNum(g_numSIZE_REQ_OPTION_3, svglobalReturnStr);
  517.                                               //MessageBox("load ini g_numSIZE_REQ_OPTION_3: " + svglobalReturnStr, INFORMATION);
  518.  
  519.  
  520.       // *************************** [MEDIA & FILE TYPES] ************************************
  521.         FindLine("[", "]", "MEDIA & FILE TYPES");
  522.         GetNextLine( "<", ">" );
  523.         StrToNum(g_numCD_ROM, svglobalReturnStr);
  524.                                               //MessageBox("load ini g_numCD_ROM: " + svglobalReturnStr, INFORMATION);
  525.         GetNextLine( "<", ">" );
  526.         StrToNum(g_numCOPY_UNCOMP, svglobalReturnStr);
  527.                                               //MessageBox("load ini g_numCOPY_UNCOMP: " + svglobalReturnStr, INFORMATION);
  528.         GetNextLine( "<", ">" );
  529.         StrToNum(g_numCOPY_COMP, svglobalReturnStr);
  530.                                               //MessageBox("load ini g_numCOPY_COMP: " + svglobalReturnStr, INFORMATION);
  531.                                                         
  532.  
  533.       // *************************** [APPLICATION PATHS] *************************************
  534.         FindLine("[", "]", "APPLICATION PATHS");
  535.         GetNextLine( "<", ">" );
  536.       g_strAPPBASE_PATH_95 = svglobalReturnStr;
  537.                                               //MessageBox("load ini g_strAPPBASE_PATH_95: " + g_strAPPBASE_PATH_95, INFORMATION);
  538.         GetNextLine( "<", ">" );
  539.       g_strAPPBASE_PATH_NT3x = svglobalReturnStr;
  540.                                               //MessageBox("load ini g_strAPPBASE_PATH_NT3x: " + g_strAPPBASE_PATH_NT3x, INFORMATION);
  541.         GetNextLine( "<", ">" );
  542.       g_strAPPBASE_PATH_NT40 = svglobalReturnStr;
  543.                                               //MessageBox("load ini g_strAPPBASE_PATH_NT40: " + g_strAPPLICATION_NAME32, INFORMATION);
  544.        
  545.        
  546.       // *************************** [REGISTRY INFO] *****************************************
  547.         FindLine("[", "]", "REGISTRY INFO");
  548.         GetNextLine( "<", ">" );
  549.         StrToNum(g_numEXTENSION_USED, svglobalReturnStr);
  550.                                               //MessageBox("load ini g_numEXTENSION_USED: " + svglobalReturnStr, INFORMATION);
  551.         GetNextLine( "<", ">" );
  552.       g_strEXTENSION = svglobalReturnStr;
  553.                                               //MessageBox("load ini g_strEXTENSION: " + g_strEXTENSION, INFORMATION);
  554.   
  555.  
  556.       // *************************** [GENERAL PRODUCT DEFINITIONS] ***************************
  557.         FindLine("[", "]", "GENERAL PRODUCT DEFINITIONS");
  558.         GetNextLine( "<", ">" );
  559.       g_strPROGRAM_GROUP_NAME = svglobalReturnStr;
  560.                                               //MessageBox("load ini g_strPROGRAM_GROUP_NAME: " + g_strPROGRAM_GROUP_NAME, INFORMATION);
  561.         GetNextLine( "<", ">" );
  562.       g_strCOMPANY_NAME = svglobalReturnStr;
  563.                                               //MessageBox("load ini g_strCOMPANY_NAME: " + g_strCOMPANY_NAME, INFORMATION);
  564.         GetNextLine( "<", ">" );
  565.       g_strBASE_REGISTRYNT = svglobalReturnStr;
  566.                                               //MessageBox("load ini g_strBASE_REGISTRYNT: " + g_strBASE_REGISTRYNT, INFORMATION);
  567.         GetNextLine( "<", ">" );
  568.       g_strBASE_REGISTRY95 = svglobalReturnStr;
  569.                                               //MessageBox("load ini g_strBASE_REGISTRY95: " + g_strBASE_REGISTRY95, INFORMATION);                     
  570.         GetNextLine( "<", ">" );
  571.       g_strSTR_COMPLETE95 = svglobalReturnStr;
  572.                                               //MessageBox("load ini g_strSTR_COMPLETE95: " + g_strAPPLICATION_NAME32, INFORMATION);
  573.         GetNextLine( "<", ">" );
  574.       g_strSTR_COMPLETENT = svglobalReturnStr;
  575.                                               //MessageBox("load ini g_strUNINSTALL_KEY: " + g_strUNINSTALL_KEY, INFORMATION);                     
  576.  
  577.         CloseSetupFile();
  578.    end;   
  579.    
  580.  
  581.  
  582. /*---------------------------------------------------------------------------*\
  583.  *
  584.  * Function:  Launch_ThirdPartyInstallers()
  585.  *
  586.  *  Purpose:  To launch addition third party installation programs.
  587.  *
  588.  *    Input:
  589.  *
  590.  *  Returns:
  591.  *
  592.  * Comments:
  593. \*---------------------------------------------------------------------------*/
  594.  
  595. function Launch_ThirdPartyInstallers()
  596.  
  597.    BOOL        blocalWhileDone;
  598.    BOOL        blocalDo3x;
  599.    BOOL        blocalDo95;
  600.    BOOL        blocalDoNT;
  601.    BOOL        blocalDoInstall;
  602.    BOOL        blocalDoPlateformInstall;
  603.    BOOL        blocalWait;
  604.  
  605.    STRING   svTemp; 
  606.    
  607.    STRING    svPlateform;
  608.    STRING    svDialogTitle;
  609.    STRING    svDialogMessage;
  610.    STRING    svInstallPath;
  611.    
  612.    STRING    svlocalRootKey;
  613.    STRING    svlocalKey;
  614.    STRING    svlocalKeyName;
  615.    
  616.    
  617.    begin
  618.        OpenSetupFile();          
  619.  
  620.       // *************************** [THIRD PARTY INSTALLATION PROGRAM] 0 - no, 1 - yes ******
  621.         FindLine("[", "]", "THIRD PARTY INSTALLATION PROGRAM");
  622.         
  623.         
  624.  
  625.  
  626.         
  627.         GetNextLine( "<", ">" );
  628.       svTemp = svglobalReturnStr;
  629.                                               
  630.         blocalDoInstall = FALSE;                                              
  631.         if(svTemp = "1") then
  632.              blocalDoInstall = TRUE;
  633.          endif;          
  634.  
  635.         while(blocalDoInstall)
  636.          
  637.         //if(blocalDoInstall) then 
  638.       
  639.             GetNextLine( "<", ">" );
  640.           svPlateform = svglobalReturnStr;
  641.                                               //MessageBox("load ini svPlateform: " + svglobalReturnStr, INFORMATION);                                                                                                                
  642.                                                                                                                 
  643.  
  644.             StrSub(svTemp, svPlateform, 0, 1);    // Get 3x 
  645.                                                 //MessageBox("blocalDo3x: " + svTemp, INFORMATION);        
  646.           if(svTemp = "1") then
  647.               blocalDo3x = TRUE;
  648.           else
  649.                  blocalDo3x = FALSE;
  650.           endif;
  651.       
  652.             StrSub(svTemp, svPlateform, 1, 1);    // Get 95 
  653.                                                 //MessageBox("blocalDo95: " + svTemp, INFORMATION);        
  654.           if(svTemp = "1") then
  655.               blocalDo95 = TRUE;
  656.           else
  657.               blocalDo95 = FALSE;
  658.           endif;
  659.       
  660.             StrSub(svTemp, svPlateform, 2, 1);    // Get NT 
  661.                                                 //MessageBox("blocalDoNT: " + svTemp, INFORMATION);        
  662.           if(svTemp = "1") then
  663.               blocalDoNT = TRUE;
  664.           else
  665.               blocalDoNT = FALSE;
  666.           endif;            
  667.       
  668.           // This is a goofy way to do it but it seems to be the only
  669.           // way to make sure I don't do an unintensional installation.
  670.             if(bWin3x) then
  671.                 if(bWin3x = blocalDo3x) then
  672.                     blocalDoPlateformInstall   = TRUE;            
  673.                 endif;
  674.             endif;
  675.         
  676.             if(bWin95) then
  677.                 if(bWin95 = blocalDo95) then
  678.                     blocalDoPlateformInstall   = TRUE;            
  679.                 endif;
  680.             endif; 
  681.         
  682.             if(bWinNT3x) then
  683.                 if(bWinNT3x = blocalDoNT) then
  684.                     blocalDoPlateformInstall   = TRUE;            
  685.                 endif;
  686.             endif;                       
  687.       
  688.           if(blocalDoPlateformInstall) then 
  689.           
  690.                  GetNextLine( "<", ">" );
  691.               svTemp = svglobalReturnStr;
  692.                                               //MessageBox("load ini blocalFindKey: " + svglobalReturnStr, INFORMATION);                     
  693.  
  694.              if(svTemp = "1") then    // we wait until we find the key in the registry
  695.  
  696.                     GetNextLine( "<", ">" );
  697.                   svlocalRootKey = svglobalReturnStr;
  698.                                               //MessageBox("load ini svlocalRootKey: " + svglobalReturnStr, INFORMATION);                    
  699.                     GetNextLine( "<", ">" );
  700.                   svlocalKey = svglobalReturnStr;
  701.                                               //MessageBox("load ini svlocalKey: " + svglobalReturnStr, INFORMATION);                    
  702.                     
  703.                if(svlocalKey = "HKEY_CLASSES_ROOT") then
  704.                    RegDBSetDefaultRoot(HKEY_CLASSES_ROOT);
  705.                elseif(svlocalKey = "HKEY_CURRENT_USER") then
  706.                    RegDBSetDefaultRoot(HKEY_CURRENT_USER);
  707.                     elseif(svlocalKey = "HKEY_LOCAL_MACHINE") then
  708.                       RegDBSetDefaultRoot(HKEY_CLASSES_ROOT);
  709.                     elseif(svlocalKey = "HKEY_USERS") then
  710.                    RegDBSetDefaultRoot(HKEY_CLASSES_ROOT);
  711.                     elseif(svlocalKey = "HKEY_CURRENT_CONFIG") then
  712.                    RegDBSetDefaultRoot(HKEY_CLASSES_ROOT);
  713.                     elseif(svlocalKey = "HKEY_DYN_DATA") then
  714.                    RegDBSetDefaultRoot(HKEY_CLASSES_ROOT);
  715.                endif;                                                      
  716.                
  717.                blocalWhileDone = FALSE;
  718.                while(!blocalWhileDone)
  719.                    if(RegDBKeyExist(svlocalKey) < 0 ) then
  720.                        //MessageBox("Failed to find the key", INFORMATION);
  721.                    else
  722.                        //MessageBox("found the key", INFORMATION);
  723.                        blocalWhileDone = TRUE;
  724.                    endif;
  725.                    Delay(1);
  726.                endwhile;
  727.              
  728.              else
  729.  
  730.                     // this gets us past the KEY stuff in the Setup.ini file                 
  731.                  GetNextLine( "<", ">" );
  732.                  GetNextLine( "<", ">" );             
  733.              
  734.              endif;          
  735.  
  736.                 GetNextLine( "<", ">" );
  737.               svTemp = svglobalReturnStr;
  738.                                               //MessageBox("load ini blocalWait: " + svglobalReturnStr, INFORMATION);  
  739.  
  740.             blocalWait = FALSE;
  741.              if(svTemp = "1") then             
  742.                   blocalWait = TRUE;
  743.               endif;
  744.               
  745.                 GetNextLine( "<", ">" );
  746.               svDialogTitle = svglobalReturnStr;
  747.                                               //MessageBox("load ini svDialogTitle: " + svglobalReturnStr, INFORMATION);  
  748.                 GetNextLine( "<", ">" );
  749.               svDialogMessage = svglobalReturnStr;
  750.                                               //MessageBox("load ini svDialogMessage: " + svglobalReturnStr, INFORMATION);                  
  751.                 GetNextLine( "<", ">" );
  752.               svInstallPath = svglobalReturnStr;
  753.                                               //MessageBox("load ini svInstallPath: " + svglobalReturnStr, INFORMATION);
  754.  
  755.  
  756.               SetDialogTitle(DLG_ASK_YESNO, svDialogTitle); 
  757.  
  758.                 if( AskYesNo(svDialogMessage, YES)    = YES) then
  759.                     svPath = SRCDISK + svInstallPath;
  760.                                                 //MessageBox("end launch: " + svPath, INFORMATION);
  761.                     Disable(BACKGROUND);
  762.                     Delay( 1 );
  763.                     
  764.                     if(blocalWait) then
  765.                                 //MessageBox("WAIT", INFORMATION);
  766.                         if(LaunchAppAndWait(svPath, "", WAIT) = 0) then
  767.                                 //MessageBox("app successfully launched", INFORMATION);
  768.                         else
  769.                                 //MessageBox("app not successfully launched", INFORMATION);                
  770.                         endif;                
  771.                     else
  772.                                 //MessageBox("NOWAIT", INFORMATION);
  773.                         if(LaunchAppAndWait(svPath, "", NOWAIT) = 0) then
  774.                                 //MessageBox("app successfully launched", INFORMATION);
  775.                         else
  776.                                 //MessageBox("app not successfully launched", INFORMATION);                
  777.                         endif;                
  778.                 
  779.                     endif;                    
  780.  
  781.                  endif;
  782.           
  783.           endif;  //if(blocalDoPlateformInstall) then
  784.  
  785.         //endif;    //if(blocalDoInstall) then
  786.         
  787.             GetNextLine( "<", ">" );
  788.             svTemp = svglobalReturnStr;
  789.                                                   
  790.             blocalDoInstall = FALSE;                                              
  791.             if(svTemp = "1") then
  792.                blocalDoInstall = TRUE;
  793.             endif;        
  794.             
  795.         endwhile;            
  796.             
  797.             
  798.        OpenSetupFile();
  799.    end;
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806. /*---------------------------------------------------------------------------*\
  807.  *
  808.  * Function:  SystemInfo()
  809.  *
  810.  *  Purpose:  To display useful system information.
  811.  *
  812.  *    Input:
  813.  *
  814.  *  Returns:
  815.  *
  816.  * Comments:
  817. \*---------------------------------------------------------------------------*/
  818.  
  819. function SystemInfo()
  820.  
  821.       STRING    svFilePath, svFileName, svVideoStr, svMidiStr, svDrive;
  822.       STRING    svAVI, svQTW, svWave, svMCI, svDrivers;
  823.       NUMBER    nvAVIFound, nvQTWFound, nvWaveFound, nvBootDesFound, nvMCIFound, nvDriversFound;
  824.       NUMBER    nvFileHandle, nvCount, nvStrPos, nvContinue, nvVideoFound, nvMidiFound;
  825.       NUMBER     nvDriveCount;
  826.    begin
  827.  
  828.         szTitle    = g_strSI_Title;    //"System Information";
  829.         szMsg        = g_strSI_Msg;     //"The following is information about your system:";
  830.  
  831.         ListInfo    = ListCreate(STRINGLIST);
  832.  
  833.         szInfo = g_strSI_System;    //"System: ";
  834.         if(bWin3x) then
  835.             szInfo = szInfo + "Win3.x";
  836.         elseif(bWinNT3x) then
  837.             szInfo = szInfo + "WinNT";
  838.         else
  839.             szInfo = szInfo + "Win95";         
  840.         endif;
  841.         ListAddString(ListInfo, szInfo, AFTER);
  842.  
  843.       //CPU check -------------
  844.       GetSystemInfo( CPU, nvReturn, svReturn );
  845.       NumToStr(svReturn, nvReturn);
  846. //          szInfo = "CPU: " + svReturn;
  847.       szInfo = g_strSI_CPU + " " + svReturn;
  848.       ListAddString(ListInfo, szInfo, AFTER);
  849.  
  850.       szInfo = "";
  851.       ListAddString(ListInfo, szInfo, AFTER);
  852.       szInfo = g_strSI_MEM;  //"MEMORY:";
  853.       ListAddString(ListInfo, szInfo, AFTER);
  854.  
  855.       //BASEMEMORY check -------------
  856.       GetSystemInfo( BASEMEMORY, nvReturn, svReturn );
  857.       NumToStr(svReturn, nvReturn);
  858.       szInfo = "     ";
  859. //      szInfo = szInfo + "Base Memory: " + svReturn;
  860.       szInfo = szInfo + g_strSI_BASEMEM + " " + svReturn;
  861.       ListAddString(ListInfo, szInfo, AFTER);
  862.  
  863.       //EXTENDEDMEMORY check -------------
  864.       GetSystemInfo( EXTENDEDMEMORY, nvReturn, svReturn );
  865.       NumToStr(svReturn, nvReturn);
  866.       szInfo = "     ";
  867. //      szInfo = szInfo + "Extended Memory: " + svReturn;
  868.       szInfo = szInfo + g_strSI_EXTENDEDMEM + " " + svReturn;
  869.       ListAddString(ListInfo, szInfo, AFTER);
  870.  
  871.       // VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO 
  872.       // VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO
  873.       szInfo = "";
  874.       ListAddString(ListInfo, szInfo, AFTER);
  875.       szInfo = g_strSI_VIDEO;     //"VIDEO:";
  876.       ListAddString(ListInfo, szInfo, AFTER);
  877.       //# COLORS check -------------
  878.       GetSystemInfo( COLORS, nvReturn, svReturn );
  879.       NumToStr(svReturn, nvReturn);
  880.       szInfo = "     ";
  881. //      szInfo = szInfo + "Colors: " + svReturn;
  882.       szInfo = szInfo + g_strSI_COLORS + " " + svReturn;      
  883.       ListAddString(ListInfo, szInfo, AFTER);
  884.  
  885.       // resolution check -------------------------------------
  886.       szInfo = "     ";
  887.       if( GetSystemInfo( VIDEO, nvReturn, svReturn ) < 0 ) then
  888. //         szInfo = szInfo + "Resolution: Unknown";
  889.          szInfo = szInfo + g_strSI_Resolution + " " + g_strSI_Unknown;         
  890.       else
  891.          switch( nvReturn ) 
  892.             case IS_EGA: szInfo = szInfo + g_strSI_Resolution + " EGA";
  893.  
  894.             case IS_VGA: szInfo = szInfo + g_strSI_Resolution + " 640 X 480"; 
  895.  
  896.             case IS_SVGA: szInfo = szInfo + g_strSI_Resolution + " 800 x 600";
  897.  
  898.             case IS_XVGA: szInfo = szInfo + g_strSI_Resolution + " 1024 x 768";
  899.  
  900.             case IS_UVGA: szInfo = szInfo + g_strSI_Resolution + " " + g_strSI_Beyond + " 1024 x 768";
  901.  
  902.             case IS_UNKNOWN: szInfo = szInfo + g_strSI_Resolution + " " + g_strSI_Unknown;
  903.          endswitch;
  904.       endif;
  905.       ListAddString(ListInfo, szInfo, AFTER);
  906.  
  907.       // Determine video driver type
  908.       // ---------------------------------------------------------------
  909.       nvReturn = FindFile(WINDIR, "system.ini", svFileName);
  910.       NumToStr(svReturn, nvReturn);
  911.       //szInfo = "Video Driver Type:";
  912.       if(nvReturn = 0 ) then
  913.          nvContinue = 1;
  914.       else
  915.          nvContinue = 0;
  916.       endif; 
  917.  
  918.       if(nvContinue = 1) then 
  919.          if (OpenFileMode(FILE_MODE_NORMAL) < 0 ) then
  920.             nvContinue = 0;
  921.          else
  922.             nvContinue = 1;
  923.          endif;
  924.       endif;
  925.  
  926.       svFilePath = WINDIR;
  927.       svFileName = "system.ini";
  928.  
  929.       if(nvContinue = 1) then 
  930.          if( OpenFile(nvFileHandle, svFilePath, svFileName) < 0 ) then
  931.             nvContinue = 0;
  932.          else
  933.             nvContinue = 1;
  934.          endif;
  935.       endif;
  936.  
  937.       if(nvContinue = 1) then
  938.          nvVideoFound = 0;
  939.          nvMidiFound  = 0;
  940.          nvAVIFound = 0;
  941.          nvQTWFound = 0;
  942.          nvWaveFound = 0;
  943.          nvBootDesFound = 0;
  944.          nvMCIFound = 0;
  945.          nvDriversFound = 0;
  946.          while( nvCount < 150 )
  947.             nvReturn = GetLine(nvFileHandle, svReturn);
  948.  
  949.             // [MCI] ***
  950.             nvStrPos = StrFind(svReturn, "[mci]");
  951.             if(nvStrPos = 0) then
  952.                nvMCIFound = 1;
  953.             endif;
  954.  
  955.             if(nvMCIFound = 1) then
  956.  
  957.              if (nvStrPos = StrFind(svReturn, "avivideo") = 0) then
  958.                //NumToStr(szFile, nvCount);
  959.                //MessageBox("avi found line: " + szFile + "  " + svReturn, INFORMATION);
  960.                svAVI = svReturn;
  961.             endif;
  962.  
  963.                if(nvStrPos = 0) then
  964.                   //if(nvAVIFound = 0) then   
  965.  
  966.                      svAVI = svReturn;
  967.                     //    MessageBox("avi: " + svAVI, INFORMATION);
  968.                      
  969.                         NumToStr(szFile, nvMCIFound);
  970.                         NumToStr(svReturn, nvAVIFound);
  971.                       //  MessageBox("nvMCIFound= " + szFile + ", nvAVIFound= " + svReturn, INFORMATION);
  972.  
  973.                      nvAVIFound = 1;
  974.                   //endif;
  975.                   nvAVIFound = 1;
  976.                endif;
  977.             endif;
  978.  
  979.             nvStrPos = StrFind(svReturn, "QTWVideo=");
  980.             if(nvMCIFound = 1) then
  981.                if(nvStrPos = 0) then
  982.                    svQTW = svReturn;
  983.                    nvQTWFound = 1;
  984.                endif;
  985.             endif;
  986.  
  987.             // [drivers] ***
  988.             nvStrPos = StrFind(svReturn, "[drivers]");
  989.             if(nvStrPos = 0) then
  990.                nvDriversFound = 1;
  991.             endif;
  992.  
  993.               nvStrPos = StrFind(svReturn, "wave=");
  994.             if(nvDriversFound = 1) then
  995.                if(nvStrPos = 0) then
  996.                    svWave = svReturn;
  997.                    nvWaveFound = 1;
  998.                endif;
  999.             endif;
  1000.  
  1001.             nvStrPos = StrFind(svReturn, "[boot.description]");
  1002.             if(nvStrPos = 0) then
  1003.                nvBootDesFound = 1;
  1004.             endif;
  1005.  
  1006.             if(nvVideoFound = 0) then
  1007.                nvStrPos = StrFind(svReturn, "display.drv=");
  1008.                if(nvStrPos = 0) then
  1009.                   if(bWin95) then
  1010.                      if(nvBootDesFound = 1) then
  1011.                         svVideoStr = svReturn;
  1012.                         nvVideoFound = 1;                     
  1013.                      endif;     
  1014.                   else
  1015.                      svVideoStr = svReturn;
  1016.                      nvVideoFound = 1;
  1017.                   endif;
  1018.                endif;
  1019.             endif;
  1020.  
  1021.             if(nvMidiFound = 0) then
  1022.                nvStrPos = StrFind(svReturn, "MIDI=");
  1023.                if(nvStrPos = 0) then
  1024.                    svMidiStr = svReturn;
  1025.                    nvMidiFound = 1;
  1026.                endif;
  1027.             endif;
  1028.             nvCount = nvCount + 1;
  1029.          endwhile;
  1030.  
  1031.       endif;
  1032.  
  1033.       if(nvVideoFound = 0) then
  1034.          svVideoStr = g_strSI_VideoTypMsg + " " + g_strSI_Unknown;    //"Video type: Unknown"; 
  1035.         endif;
  1036.  
  1037.       if(nvMidiFound = 0) then
  1038.            svMidiStr  = g_strSI_MidiDrTypMsg + " " + g_strSI_Unknown;    //"Midi driver: Unknown";  
  1039.       endif;
  1040.  
  1041.       //if(nvMCIFound 
  1042.  
  1043.       szInfo = "     ";
  1044.       szInfo = szInfo + svVideoStr;
  1045.       ListAddString(ListInfo, szInfo, AFTER);
  1046.  
  1047.  
  1048.       // MULTIMEDIA MULTIMEDIA MULTIMEDIA MULTIMEDIA MULTIMEDIA MULTIMEDIA
  1049.       // MULTIMEDIA MULTIMEDIA MULTIMEDIA MULTIMEDIA MULTIMEDIA MULTIMEDIA
  1050.        szInfo = "";
  1051.       ListAddString(ListInfo, szInfo, AFTER);
  1052.       szInfo = g_strSI_MULTIMEDMSG;     //"MULTIMEDIA:";
  1053.       ListAddString(ListInfo, szInfo, AFTER);
  1054.  
  1055.       szInfo = "     ";
  1056.       if(nvAVIFound = 1) then 
  1057.          szInfo = szInfo + svAVI;
  1058.          ListAddString(ListInfo, szInfo, AFTER);
  1059.       else
  1060. //         szInfo = szInfo + "avivideo=Not detected";
  1061.          szInfo = szInfo + g_strSI_Avi + g_strSI_NotDetected;         
  1062.          
  1063.          
  1064.          ListAddString(ListInfo, szInfo, AFTER);
  1065.       endif;
  1066.  
  1067.       szInfo = "     ";
  1068.       if(nvQTWFound = 1) then
  1069. //         szInfo = szInfo + "QTWVideo=Detected";
  1070.          szInfo = szInfo + g_strSI_QTW + g_strSI_Detected;
  1071.          ListAddString(ListInfo, szInfo, AFTER);
  1072.       else
  1073. //         szInfo = szInfo + "QTWVideo=Not detected";
  1074.          szInfo = szInfo + g_strSI_QTW + g_strSI_NotDetected;         
  1075.          ListAddString(ListInfo, szInfo, AFTER);
  1076.       endif;
  1077.  
  1078.       szInfo = "     ";
  1079.       if(nvWaveFound = 1) then
  1080.          szInfo = szInfo + svWave;
  1081.          ListAddString(ListInfo, szInfo, AFTER);
  1082.       else
  1083. //         szInfo = szInfo + "wave=Not detected";
  1084.          szInfo = szInfo + g_strSI_Wave + g_strSI_NotDetected;         
  1085.          ListAddString(ListInfo, szInfo, AFTER);
  1086.       endif;
  1087.  
  1088.       szInfo = "     ";
  1089.       szInfo = szInfo + svMidiStr;
  1090.       ListAddString(ListInfo, szInfo, AFTER);
  1091.  
  1092.       // DRIVE INFO DRIVE INFO DRIVE INFO DRIVE INFO DRIVE INFO DRIVE INFO
  1093.       // DRIVE INFO DRIVE INFO DRIVE INFO DRIVE INFO DRIVE INFO DRIVE INFO
  1094.       szInfo = "";
  1095.       ListAddString(ListInfo, szInfo, AFTER);
  1096.       szInfo = g_strSI_DriveInfo; //"DRIVE INFO:";
  1097.       ListAddString(ListInfo, szInfo, AFTER);
  1098.  
  1099.       //CDROM check ----------------
  1100.       GetSystemInfo( CDROM, nvReturn, svReturn );
  1101.       szInfo = "     ";
  1102.       if( nvReturn = TRUE ) then
  1103. //         szInfo = szInfo + "CD-ROM detected: yes";
  1104.          szInfo = szInfo + g_strSI_CDROM + " " + g_strSI_Detected;
  1105.       else
  1106. //           szInfo = szInfo + "CD-ROM detected: no";
  1107.            szInfo = szInfo + g_strSI_CDROM + " " + g_strSI_NotDetected;
  1108.       endif;
  1109.       ListAddString(ListInfo, szInfo, AFTER);
  1110.  
  1111.       // determine drive type and space available
  1112.  
  1113.       for nvDriveCount = 1 to 5
  1114.          if(nvDriveCount = 1) then
  1115.             svDrive = "C:";
  1116.          elseif(nvDriveCount = 2) then
  1117.             svDrive = "D:";
  1118.          elseif(nvDriveCount = 3) then
  1119.             svDrive = "E:";
  1120.          elseif(nvDriveCount = 4) then
  1121.             svDrive = "F:";
  1122.          elseif(nvDriveCount = 5) then
  1123.             svDrive = "G:";
  1124.          endif;
  1125.  
  1126.          if( GetSystemInfo( DRIVE, nvReturn, svDrive ) < 0 ) then
  1127.                   szInfo = "     ";
  1128.                 szInfo = szInfo + svDrive + " " + g_strSI_Unknown; //" undetermined,";
  1129.          else
  1130.               szInfo = "     ";
  1131.             szInfo = szInfo + svDrive;
  1132.                 switch( nvReturn ) 
  1133.                case IS_FIXED:         szInfo = szInfo + " " + g_strSI_DrTypeFixed;     //" fixed,";
  1134.                case IS_REMOVABLE:    szInfo = szInfo + " " + g_strSI_DrTypeRemov;     //" removable,";
  1135.                case IS_REMOTE:        szInfo = szInfo + " " + g_strSI_DrTypeRemote;     //" network,";
  1136.                case IS_UNKNOWN:        szInfo = szInfo + " " + g_strSI_Unknown;             //" unknown,";
  1137.                default:                szInfo = szInfo + " " + g_strSI_Unknown;                 //" unknown,";
  1138.              endswitch;
  1139.          endif;
  1140.  
  1141.          nvReturn = GetDiskSpace(svDrive);
  1142.          nvReturn = nvReturn / 1048576; // divide by 1 mbyte
  1143.          NumToStr( svReturn, nvReturn );
  1144.  
  1145. //         szInfo = szInfo + " Free Space: " + svReturn + " MB";
  1146.          szInfo = szInfo + " " + g_strSI_FreeSpace + " " + svReturn + g_strSI_MB;         
  1147.  
  1148.          ListAddString(ListInfo, szInfo, AFTER);
  1149.          // ***
  1150.       endfor;
  1151.  
  1152.         Disable( BACKBUTTON );
  1153.         SdShowInfoList( szTitle, szMsg, ListInfo );
  1154.       Enable( BACKBUTTON );
  1155.  
  1156.    end;
  1157.  
  1158.  
  1159. /* -------------------------------------------------------------------------
  1160.  * Function:    CompressedFileTransferList()
  1161.  * Purpose:        
  1162.  *
  1163.  * -------------------------------------------------------------------------*/ 
  1164.  
  1165. function CompressedFileTransferList() 
  1166.    begin
  1167.       TARGETDIR = svMainDirectory;
  1168.       Enable(STATUS);
  1169. //      SetStatusWindow(0, "Copying and Decompressing Files...");
  1170.       SetStatusWindow(0, g_strCFTL_SetStatusWindowMsg);
  1171.  
  1172.       TARGETDIR = svMainDirectory;
  1173.       //szFileSet = "General";
  1174.       szFileSet = "copyfile";
  1175.  
  1176.       if(bTypical) then
  1177.          //Include the TYPICAL file set
  1178.          FileSetBeginDefine("copyfile");
  1179.          szTargetDir = TARGETDIR;
  1180.         
  1181.          if( bWinNT3x ) then 
  1182.             TARGETDIR = WINDIR + "system32"; 
  1183.             CompressGet( "data.z", "file1\\*.*", SHAREDFILE|COMP_UPDATE_DATE );
  1184.          endif;
  1185.  
  1186.          if( bWin95 ) then 
  1187.             TARGETDIR = WINDIR + "system";
  1188.             CompressGet( "data.z", "file1\\*.*", SHAREDFILE|COMP_UPDATE_DATE );
  1189.          endif;
  1190.  
  1191.             TARGETDIR = szTargetDir;
  1192.          FileSetEndDefine("copyfile");
  1193.       endif;
  1194. /*
  1195.       if(bCompact) then
  1196.          //Include the COMPACT file set
  1197.          FileSetBeginDefine(szFileSet);
  1198.             //StatusUpdate(ON, 40);
  1199.             CompressGet( "data.z", "program\\*.*", COMP_NORMAL );
  1200.             //StatusUpdate(OFF, 0);
  1201.             //StatusUpdate(ON, 60);
  1202.             CompressGet( "data.z", "File1\\*.*", COMP_NORMAL );
  1203.          FileSetEndDefine(szFileSet);
  1204.       endif;
  1205.  
  1206.  
  1207.       if(bCostum) then
  1208.          if(bCustom1) then
  1209.             //Include the CUSTOM file set 1
  1210.             FileSetBeginDefine(szFileSet);
  1211.                //StatusUpdate(ON, 40);
  1212.                CompressGet( "data.z", "program\\*.*", COMP_NORMAL );
  1213.                //StatusUpdate(OFF, 0);
  1214.                //StatusUpdate(ON, 60);
  1215.                CompressGet( "data.z", "File1\\*.*", COMP_NORMAL );
  1216.             FileSetEndDefine(szFileSet);
  1217.          endif;
  1218.  
  1219.          if(bCustom2) then
  1220.             //Include the CUSTOM file set 2
  1221.             FileSetBeginDefine(szFileSet);
  1222.                //StatusUpdate(ON, 40);
  1223.                CompressGet( "data.z", "program\\*.*", COMP_NORMAL );
  1224.                //StatusUpdate(OFF, 0);
  1225.                //StatusUpdate(ON, 60);
  1226.                CompressGet( "data.z", "File1\\*.*", COMP_NORMAL );
  1227.             FileSetEndDefine(szFileSet);
  1228.          endif;
  1229.  
  1230.          if(bCustom3) then
  1231.             //Include the CUSTOM file set 3
  1232.             FileSetBeginDefine(szFileSet);
  1233.                //StatusUpdate(ON, 40);
  1234.                CompressGet( "data.z", "program\\*.*", COMP_NORMAL );
  1235.                //StatusUpdate(OFF, 0);
  1236.                //StatusUpdate(ON, 60);
  1237.                CompressGet( "data.z", "File1\\*.*", COMP_NORMAL );
  1238.             FileSetEndDefine(szFileSet);
  1239.          endif;
  1240.       endif;  // CUSTOM
  1241.  
  1242. */
  1243.  
  1244.       StatusUpdate(ON, 100);
  1245.       // MessageBox("SUPPORTDIR: " + SUPPORTDIR, INFORMATION);
  1246.       // MessageBox("Files copied to: " + TARGETDIR, INFORMATION);       
  1247.       FileSetPerformEz("copyfile", 0);
  1248.  
  1249.    end;
  1250.  
  1251. /* -------------------------------------------------------------------------
  1252.  * Function:    Multiple_Installation_Options()
  1253.  * Purpose:        
  1254.  *
  1255.  * -------------------------------------------------------------------------*/
  1256.  
  1257.  
  1258.  
  1259. //        STRING    g_strMIO_SetupType;    
  1260. //        STRING    g_strMIO_SetDialogTitle;
  1261. //        STRING    g_strMIO_AskOptionsMessage;
  1262. //        STRING    g_strMIO_AskOptionsDescription1;
  1263. //        STRING    g_strMIO_AskOptionsDescription2;
  1264. //        STRING    g_strMIO_AskOptionsDescription3;
  1265.  
  1266.  
  1267.  
  1268. function Multiple_Installation_Options()
  1269.     NUMBER nvLocalResult;
  1270.    begin
  1271.         nvRETURN          = 0;
  1272.       nvLocalResult     = 0;
  1273.         nType             = 301;
  1274.       nType             = SetupType( g_strMIO_SetupType, "", svMainDirectory, nType, 0 );
  1275.  
  1276.         if ( nType = BACK ) then
  1277.          //MessageBox("in: Multiple_Installation_Options. nvReturn = 1", INFORMATION);       
  1278.          nvRETURN = 1; // set for:  goto GetTargetDirectory
  1279.       endif;
  1280.  
  1281.         if(nvRETURN = 0) then
  1282.  
  1283.             bReshowSetupType     = FALSE;
  1284.             bTypical                = FALSE;
  1285.             bCompact            = FALSE; 
  1286.            bCostum                = FALSE;
  1287.              bCustom1                = FALSE;
  1288.              bCustom2                = FALSE;
  1289.              bCustom3                = FALSE;
  1290.  
  1291.             // ***** DETERMINES THE 3 OPTIONS THE USER CAN SELECT - CHANGE THESE AS APPROPRIATE *****
  1292.  
  1293.          switch (nType)
  1294.              case TYPICAL:
  1295.                     bInclude_Copyset1    = TRUE; 
  1296.  
  1297.              case COMPACT:
  1298.                     bInclude_Copyset3    = TRUE;
  1299.             
  1300.              case CUSTOM:
  1301.                 SetDialogTitle( DLG_ASK_OPTIONS, g_strMIO_SetDialogTitle );
  1302.  
  1303.                 szMsg = g_strMIO_AskOptionsMessage;
  1304.  
  1305.                 nvLocalResult = AskOptions(     EXCLUSIVE, szMsg,
  1306.                                                       g_strMIO_AskOptionsDescription1, bInclude_Copyset1,
  1307.                                                       g_strMIO_AskOptionsDescription2, bInclude_Copyset2, 
  1308.                                                       g_strMIO_AskOptionsDescription3, bInclude_Copyset3);
  1309.  
  1310.          endswitch;     
  1311.         endif;
  1312.       
  1313.  
  1314.         if ( nvLocalResult = BACK ) then
  1315.          nvRETURN = 2; // set for:  goto DetermineUserSelection
  1316.       endif;
  1317.  
  1318.       // Handle user clicking Cancel button.
  1319. /*      
  1320.         if(nvRETURN = 0) then
  1321.          if (nvLocalResult = CANCEL) then
  1322.             if (AskYesNo( "Are you sure you would like to exit setup?", NO ) = YES) then
  1323.                abort;
  1324.             else
  1325.                bReshowSetupType = TRUE;
  1326.             endif;
  1327.          endif;
  1328.         endif;
  1329. */        
  1330.  
  1331.       if (bReshowSetupType = TRUE) then       
  1332.          nvRETURN = 2; // set for: goto DetermineUserSelection
  1333.       endif;
  1334.  
  1335.       // Check to see if target system meets space requirements.
  1336.         if( nvRETURN = 0 ) then
  1337.           bSpaceOk = CheckSpaceRequirements(     bInclude_Copyset1, 
  1338.                                                            bInclude_Copyset2, 
  1339.                                                            bInclude_Copyset3, 
  1340.                                                              svUserDestDrive );  
  1341.                                                
  1342.          // Ask user to try again if not enough space available.
  1343.          if (bSpaceOk = FALSE) then
  1344.             nvRETURN = 1; // set for: goto GetTargetDirectory;
  1345.          endif;                                                                      
  1346.       endif;
  1347.    end;
  1348.  
  1349. /* -------------------------------------------------------------------------*\
  1350.  * Function:    Single_Installation_Option()
  1351.  *
  1352.  *  Purpose:    This section used if only one set of files to install.
  1353.  *                This sets up the sections of files & compressed files to copy
  1354.  *                Also checks the total space required.
  1355.  *
  1356.  *    Input:     
  1357.  *
  1358.  *  Returns:     
  1359.  *
  1360.  * Comments:    Edit these section if needed.
  1361.  *
  1362. \*-------------------------------------------------------------------------*/
  1363.  
  1364. function Single_Installation_Option()
  1365.    begin
  1366.       // **********************************
  1367.       // CHANGE THESE AS APPROPRIATE
  1368.  
  1369.         bTypical             = TRUE;
  1370.         bCompact             = FALSE;
  1371.         bCostum              = FALSE;
  1372.       bCustom1             = FALSE;
  1373.       bCustom2             = FALSE;
  1374.       bCustom3             = FALSE;
  1375.  
  1376.       bInclude_Copyset1 = TRUE;
  1377.       bInclude_Copyset2 = FALSE; 
  1378.       bInclude_Copyset3 = FALSE;
  1379.  
  1380.       bSpaceOk = CheckSpaceRequirements(     bInclude_Copyset1, 
  1381.                                                        bInclude_Copyset2, 
  1382.                                                        bInclude_Copyset3, 
  1383.                                           svUserDestDrive );   
  1384.  
  1385.    end;
  1386.  
  1387.  
  1388. /* -------------------------------------------------------------------------*\
  1389.  * Function:    DetermineOS()
  1390.  *
  1391.  * Purpose:        To determine the current operating system.
  1392.  *                    Set the appropriate path and product name.
  1393.  *
  1394.  *    Input:    GetSystemInfo, 
  1395.  *
  1396.  *  Returns:    szApplicationName,APPBASE_PATH,nvOS32_16 
  1397.  *
  1398.  * Comments:    
  1399.  *                
  1400. \*-------------------------------------------------------------------------*/
  1401.  
  1402. function DetermineOS()
  1403.    NUMBER nvLocalValue;
  1404.    STRING svLocalResult;
  1405.  
  1406. begin
  1407.  
  1408.    GetSystemInfo(OS, nvResult, svResult);
  1409.    bWinNT3x    = FALSE;
  1410.    bWinNT40 = FALSE;
  1411.    bWin3x    = FALSE;
  1412.    bWin95    = FALSE;
  1413.  
  1414.    if(nvResult = IS_WINDOWS) then
  1415.       bWin3x             = TRUE;                    //Program should exit 32-bit installer
  1416.       szApplicationName    = g_strAPPLICATION_NAME32;    // if running under Win 3.x  
  1417.       APPBASE_PATH         = g_strAPPBASE_PATH_95;
  1418.       nvOS32_16         = 0;
  1419.    elseif(nvResult = IS_WINDOWSNT) then
  1420.    
  1421.         GetSystemInfo (OSMAJOR, nvResult, svResult);
  1422.  
  1423.         if(nvResult < 4) then
  1424.             bWinNT3x                = TRUE;
  1425.             szApplicationName    = g_strAPPLICATION_NAME32;
  1426.             APPBASE_PATH         = g_strAPPBASE_PATH_NT3x;
  1427.             nvOS32_16            = 1;
  1428.         else
  1429.             bWinNT40                = TRUE;
  1430.             szApplicationName    = g_strAPPLICATION_NAME32;
  1431.             APPBASE_PATH         = g_strAPPBASE_PATH_NT40;
  1432.             nvOS32_16            = 1;
  1433.         endif;   
  1434.  
  1435.    elseif(nvResult = IS_WINDOWS95) then
  1436.       bWin95            = TRUE;
  1437.       szApplicationName    = g_strAPPLICATION_NAME32;
  1438.       APPBASE_PATH         = g_strAPPBASE_PATH_95;
  1439.       nvOS32_16            = 1;
  1440.    endif;
  1441.           
  1442.    nvQuitInstaller = 0;
  1443.    if(nvOS32_16 = 1) then
  1444.       nvQuitInstaller = 1;
  1445.    endif;
  1446.  
  1447. end;                               
  1448.                                 
  1449. /* -------------------------------------------------------------------------*\
  1450.  * Function:    CopyFiles()
  1451.  *
  1452.  *  Purpose:    To copy files from the source directory to the destination 
  1453.  *                directory.
  1454.  *
  1455.  *    Input:    g_numCOPY_UNCOMP, SCRDIR, TARGETDIR, CD_ROM
  1456.  *
  1457.  *  Returns:
  1458.  *
  1459.  * Comments:    Edit this function as required.
  1460.  *              Performs file copies of UNCOMPRESSED files.
  1461.  *              Copies files for multiple install options if required.  
  1462. \* -------------------------------------------------------------------------*/                                
  1463. function CopyFiles()                                
  1464.   
  1465.    STRING    svlocalSOURC_LOCATION;
  1466.    STRING    svlocalTARGET_LOCATION;
  1467.       STRING    svlocalSaveSourceDir;
  1468.       STRING    svlocalSaveTargetDir;
  1469.       
  1470.    BOOL        blocalDo3x;
  1471.    BOOL        blocalDo95;
  1472.    BOOL        blocalDoNT;
  1473.    
  1474.    BOOL        blocalDoCopySet1;  
  1475.    BOOL        blocalDoCopySet2;
  1476.    BOOL        blocalDoCopySet3;
  1477.    
  1478.    BOOL        blocalDone;  
  1479.    BOOL        blocalDoPlateformCopy;
  1480.    BOOL        blocalDoCopySet;
  1481.    
  1482.    NUMBER    nvlocalFileSetSize;
  1483.    NUMBER    nvlocalFileSize;
  1484.    NUMBER    nvlocalTotalFileSize;
  1485.    NUMBER    nvlocalUpdateNum;
  1486.    
  1487.    NUMBER   nvlocalInitialStatus;
  1488.    
  1489.    NUMBER   nvlocalResult, nvlocalFileHandle;
  1490.    NUMBER    nvlocalFirstPos, nvlocalLastPos;
  1491.    NUMBER    nvStrLength;
  1492.       
  1493.       
  1494.    STRING   svlocalFilePath, svlocalFileName;
  1495.    STRING   svlocalLine, svlocalFirstChar;
  1496.    STRING   svTemp; 
  1497.    STRING    svlocalStr;
  1498.    STRING    svlocalEatStr;
  1499.    STRING    svlocalStoreStr;
  1500.      
  1501.     STRING    svlocalGROUP_NAME;
  1502.     STRING    svlocalITEM_NAME;
  1503.     STRING    svlocalAPP_PATH;
  1504.     STRING    svlocalAPP_DIR;
  1505.     STRING    svlocalICON_PATH;
  1506.      
  1507.   
  1508.    begin
  1509.         Enable(STATUS);
  1510.        nvlocalTotalFileSize    = 0;          
  1511.         svlocalSaveSourceDir = SRCDIR;
  1512.         svlocalSaveTargetDir = svMainDirectory; 
  1513.         
  1514.        blocalDone            = FALSE;
  1515.    
  1516.        svlocalFilePath    =     svlocalSaveSourceDir;
  1517.        svlocalFileName    =    "Setup.ini";
  1518.  
  1519.        OpenFileMode(FILE_MODE_NORMAL);
  1520.       OpenFile(nvlocalFileHandle, svlocalFilePath, svlocalFileName);
  1521.       nvlocalResult = 0;
  1522.       while(!blocalDone)
  1523.           nvlocalResult = nvlocalResult + 1; 
  1524.           if(nvlocalResult > g_numMAX_LINES_INI) then
  1525.               blocalDone = TRUE;
  1526.               MessageBox("Setup.ini Error2: not correct line.", INFORMATION);
  1527.           endif;                                  
  1528.             
  1529.             GetLine(nvlocalFileHandle, svlocalLine);
  1530.             nvlocalFirstPos     = StrFind(svlocalLine, "[") + 1;
  1531.             nvlocalLastPos     = StrFind(svlocalLine, "]");
  1532.             nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  1533.              StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);   
  1534.        
  1535.              if( StrCompare(svTemp, "COPY FILE LIST") = 0) then
  1536.                  blocalDone = TRUE;
  1537.              endif;
  1538.       endwhile;      
  1539.                                               //MessageBox("COPY_FILE: " + svlocalLine, INFORMATION);
  1540.         /*  get COPY_FILE 0 - no, 1 - yes */        
  1541.       GetLine(nvlocalFileHandle, svlocalLine);
  1542.         nvlocalFirstPos     = StrFind(svlocalLine, "<") + 1;
  1543.         nvlocalLastPos     = StrFind(svlocalLine, ">");
  1544.         nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  1545.          StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
  1546.          if(svTemp = "0") then
  1547.              blocalDone = TRUE;
  1548.          else
  1549.              blocalDone = FALSE;
  1550.          endif; 
  1551.          
  1552.         /*  get INITIAL_STATUS */
  1553.       GetLine(nvlocalFileHandle, svlocalLine);
  1554.         nvlocalFirstPos     = StrFind(svlocalLine, "<") + 1;
  1555.         nvlocalLastPos     = StrFind(svlocalLine, ">");
  1556.         nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  1557.          StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
  1558.          StrToNum(nvlocalInitialStatus, svTemp);
  1559.         
  1560.       SetStatusWindow(nvlocalInitialStatus, "Copying files... "); 
  1561.       
  1562.        /* get the next line */
  1563.       GetLine(nvlocalFileHandle, svlocalLine);
  1564.         nvlocalFirstPos     = StrFind(svlocalLine, "-") + 1;
  1565.         nvlocalLastPos     = StrFind(svlocalLine, "<");
  1566.         nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  1567.          StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength); 
  1568.          
  1569.         nvlocalFirstPos     = StrFind(svlocalLine, "<") + 1;
  1570.         nvlocalLastPos     = StrFind(svlocalLine, ">");
  1571.         nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  1572.          StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);         
  1573.                   //MessageBox("getline: " + svTemp, INFORMATION);
  1574.         while(!blocalDone)
  1575.             if(svTemp = "SOURCE_LOCATION") then  
  1576.             
  1577.                 nvlocalFirstPos     = StrFind(svlocalLine, "<") + 1;
  1578.                 nvlocalLastPos     = StrFind(svlocalLine, "\\");
  1579.                 nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  1580.                  StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);         
  1581.                   //MessageBox("1here getline: " + svlocalStr, INFORMATION);            
  1582.             
  1583.                 if(svlocalStr = "SRCDIR") then 
  1584.                 
  1585.                     nvlocalFirstPos     = StrFind(svlocalLine, "\\") + 1;
  1586.                     nvlocalLastPos     = StrFind(svlocalLine, ">");
  1587.                     nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  1588.                      StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);                
  1589.                     SRCDIR = svlocalSaveSourceDir ^ svlocalStr; 
  1590.                                                 //MessageBox("svlocalStr: " + svlocalStr, INFORMATION);
  1591.                                            //MessageBox("SRCDIR = svlocalSaveSourceDir: " + SRCDIR, INFORMATION);
  1592.                 elseif(svlocalStr = "SRCDISK") then
  1593.                 
  1594.                     nvlocalFirstPos     = StrFind(svlocalLine, "\\") + 1;
  1595.                     nvlocalLastPos     = StrFind(svlocalLine, ">");
  1596.                     nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  1597.                      StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);         
  1598.                                       //MessageBox("2here getline: " + svlocalStr, INFORMATION);                    
  1599.                    SRCDIR = SRCDISK ^ svlocalStr; 
  1600.                                      //MessageBox("SRCDIR = SRCDISK: " + SRCDIR, INFORMATION);
  1601.                 else
  1602.                     MessageBox("Unknown value in-SOURCE_LOCATION" + svlocalLine, INFORMATION);
  1603.                 endif;
  1604.                                                     //MessageBox("SRCDIR: " + SRCDIR, INFORMATION);
  1605.                                                                 
  1606.             elseif(svTemp = "TARGET_LOCATION") then 
  1607.  
  1608.                 if(svlocalStr = "TARGETDIR") then
  1609.                     TARGETDIR = svlocalSaveTargetDir; 
  1610.                 elseif(svlocalStr = "TARGETDISK") then
  1611.                    TARGETDIR = TARGETDISK;
  1612.                 elseif(svlocalStr = "WINDIR") then
  1613.                    TARGETDIR = WINDIR;                
  1614.                 elseif(svlocalStr = "WINDISK") then        
  1615.                    TARGETDIR = WINDISK;                
  1616.                 elseif(svlocalStr = "WINSYSDIR") then
  1617.                    TARGETDIR = WINSYSDIR;                
  1618.                 elseif(svlocalStr = "WINSYSDISK") then
  1619.                    TARGETDIR = WINSYSDISK;                
  1620.                 else
  1621.                     MessageBox("Unknown value in-TARGET_LOCATION:" + svlocalLine, INFORMATION);
  1622.                 endif;            
  1623.  
  1624.                                                     //MessageBox("TARGETDIR: " + TARGETDIR, INFORMATION);
  1625.             elseif(svTemp = "FILE") then
  1626.                
  1627.                // Let's get the BOOL value for the file plateform
  1628.                 nvlocalFirstPos     = StrFind(svlocalLine, ":") + 1;
  1629.                 nvlocalLastPos     = StrFind(svlocalLine, ",");
  1630.                 nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  1631.                  StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);               
  1632.                
  1633.                 StrSub(svTemp, svlocalStr, 0, 1);    // Get 3x 
  1634.                                                                                                                 //MessageBox("blocalDo3x: " + svTemp, INFORMATION);        
  1635.               if(svTemp = "1") then
  1636.                   blocalDo3x = TRUE;
  1637.               else
  1638.                      blocalDo3x = FALSE;
  1639.               endif;
  1640.       
  1641.                 StrSub(svTemp, svlocalStr, 1, 1);    // Get 95 
  1642.                                                                                                                 //MessageBox("blocalDo95: " + svTemp, INFORMATION);        
  1643.               if(svTemp = "1") then
  1644.                   blocalDo95 = TRUE;                                                   
  1645.               else
  1646.                   blocalDo95 = FALSE;
  1647.               endif;
  1648.       
  1649.                 StrSub(svTemp, svlocalStr, 2, 1);    // Get NT 
  1650.                                                                                                                 //MessageBox("blocalDoNT: " + svTemp, INFORMATION);        
  1651.               if(svTemp = "1") then
  1652.                   blocalDoNT = TRUE;
  1653.               else
  1654.                   blocalDoNT = FALSE;
  1655.               endif;            
  1656.       
  1657.               // This is a goofy way to do it but it seems to be the only
  1658.               // way to make sure I don't do an unintensional installation. 
  1659.               blocalDoPlateformCopy   = FALSE;
  1660.                 if(bWin3x) then
  1661.                     if(bWin3x = blocalDo3x) then
  1662.                         blocalDoPlateformCopy   = TRUE;            
  1663.                     endif;
  1664.                 endif;
  1665.         
  1666.                 if(bWin95) then
  1667.                     if(bWin95 = blocalDo95) then
  1668.                         blocalDoPlateformCopy   = TRUE;            
  1669.                     endif;
  1670.                 endif; 
  1671.         
  1672.                 if(bWinNT3x) then
  1673.                     if(bWinNT3x = blocalDoNT) then
  1674.                         blocalDoPlateformCopy   = TRUE;            
  1675.                     endif;
  1676.                 endif;
  1677.                 
  1678.             if(blocalDoPlateformCopy) then
  1679.             
  1680.                    // Let's get the BOOL value for the copyset
  1681.                     nvlocalFirstPos     = StrFind(svlocalLine, ",") + 1;
  1682.                     nvlocalLastPos     = StrFind(svlocalLine, ">") + 1;
  1683.                     nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  1684.                      StrSub(svlocalStoreStr, svlocalLine, nvlocalFirstPos, nvStrLength);
  1685.                                                      //MessageBox("BOOL: " + svlocalStoreStr, INFORMATION);
  1686.                      StrSub(svlocalEatStr, svlocalStoreStr, 8, 3);    // 
  1687.                      
  1688.                      
  1689.                     StrSub(svTemp, svlocalEatStr, 0, 1);    // Get CopySet1 BOOL value 
  1690.                                                             //MessageBox("blocalDoCopySet1: " + svTemp, INFORMATION);        
  1691.                   if(svTemp = "1") then
  1692.                           blocalDoCopySet1 = TRUE;
  1693.                   else
  1694.                              blocalDoCopySet1 = FALSE;
  1695.                   endif;
  1696.       
  1697.                     StrSub(svTemp, svlocalEatStr, 1, 1);    // Get CopySet2 BOOL value 
  1698.                                                             //MessageBox("blocalDoCopySet2: " + svTemp, INFORMATION);        
  1699.                   if(svTemp = "1") then
  1700.                       blocalDoCopySet2 = TRUE;                                                   
  1701.                   else
  1702.                       blocalDoCopySet2 = FALSE;
  1703.                   endif;
  1704.       
  1705.                     StrSub(svTemp, svlocalEatStr, 2, 1);    // Get CopySet3 BOOL value 
  1706.                                                             //MessageBox("blocalDoCopySet3: " + svTemp, INFORMATION);        
  1707.                   if(svTemp = "1") then
  1708.                       blocalDoCopySet3 = TRUE;
  1709.                   else
  1710.                       blocalDoCopySet3 = FALSE;
  1711.                   endif;
  1712.                   
  1713.                   blocalDoCopySet = FALSE;
  1714.                   // This is a goofy way to do it but it seems to be the only
  1715.                   // way to make sure I don't do an unintensional installation. 
  1716.                   blocalDoPlateformCopy   = FALSE;
  1717.                     if(bInclude_Copyset1) then
  1718.                         if(bInclude_Copyset1 = blocalDoCopySet1) then
  1719.                             blocalDoCopySet   = TRUE;
  1720.                             nvlocalFileSetSize    = g_numSIZE_REQ_OPTION_1;                                        
  1721.                         endif;
  1722.                     endif;
  1723.         
  1724.                     if(bInclude_Copyset2) then
  1725.                         if(bInclude_Copyset2 = blocalDoCopySet2) then
  1726.                             blocalDoCopySet   = TRUE;
  1727.                             nvlocalFileSetSize    = g_numSIZE_REQ_OPTION_2;                                        
  1728.                         endif;
  1729.                     endif; 
  1730.         
  1731.                     if(bInclude_Copyset3) then
  1732.                         if(bInclude_Copyset3 = blocalDoCopySet3) then
  1733.                             blocalDoCopySet   = TRUE;
  1734.                             nvlocalFileSetSize    = g_numSIZE_REQ_OPTION_3;                                        
  1735.                         endif;
  1736.                     endif;
  1737.  
  1738.                     // error message                  
  1739.                  if(nvlocalFileSetSize = 0) then
  1740.                      MessageBox("ERROR: SIZE_REQ_OPTION_N cannot be 0", INFORMATION);
  1741.                  endif;   
  1742.                         
  1743.                  if(blocalDoCopySet) then                 
  1744.                        // Let's get the name of the file to copy
  1745.                         nvlocalFirstPos     = StrFind(svlocalStoreStr, ",") + 1;
  1746.                         nvlocalLastPos     = StrFind(svlocalStoreStr, ">") + 1;
  1747.                         nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  1748.                          StrSub(svlocalEatStr, svlocalStoreStr, nvlocalFirstPos, nvStrLength);
  1749.                  
  1750.                         nvlocalFirstPos     = StrFind(svlocalEatStr, ":") + 1;
  1751.                         nvlocalLastPos     = StrFind(svlocalEatStr, ">");
  1752.                         nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  1753.                          StrSub(svlocalFileName, svlocalEatStr, nvlocalFirstPos, nvStrLength);
  1754.                                                                                 
  1755.                         // Let's get the file size.
  1756.                         svlocalLine = SRCDIR ^ svlocalFileName;
  1757.                                                         //MessageBox("FilePath: " + svlocalLine, INFORMATION);                                    
  1758.                         GetFileInfo(svlocalLine, FILE_SIZE, nvlocalFileSize, svTemp);
  1759.                         nvlocalTotalFileSize = nvlocalTotalFileSize + nvlocalFileSize;
  1760.                         NumToStr(svTemp, nvlocalFileSize);
  1761.                                                         //MessageBox("FileSize: " + svTemp, INFORMATION);
  1762.                                                         
  1763.                         nvlocalUpdateNum    =     (nvlocalTotalFileSize * 100) / (nvlocalFileSetSize);  
  1764.                         if(nvlocalUpdateNum > 95) then
  1765.                             nvlocalUpdateNum = 95;
  1766.                         endif;
  1767.                         
  1768.                         NumToStr(svTemp, nvlocalUpdateNum);
  1769.                                                         //MessageBox("nvlocalUpdateNum: " + svTemp, INFORMATION);                        
  1770.                                                         
  1771.                        StatusUpdate(ON, nvlocalUpdateNum);                                                   
  1772.                        CopyFile(svlocalFileName, svlocalFileName); 
  1773.                        StatusUpdate(OFF, nvlocalUpdateNum);
  1774.                                                          
  1775.                     endif; //if(blocalDoCopySet) then
  1776.                                                     
  1777.                 endif; //if(blocalDoPlateformCopy) then
  1778.                                                     
  1779.                                                     
  1780.                                                                                                                 
  1781.             else
  1782.                 blocalDone = TRUE;
  1783.                                                     //MessageBox("DONE: " + svlocalLine, INFORMATION);
  1784.             endif;
  1785.             
  1786.           GetLine(nvlocalFileHandle, svlocalLine);
  1787.             nvlocalFirstPos     = StrFind(svlocalLine, "-") + 1;
  1788.             nvlocalLastPos     = StrFind(svlocalLine, "<");
  1789.             nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  1790.              StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
  1791.              
  1792.             nvlocalFirstPos     = StrFind(svlocalLine, "<") + 1;
  1793.             nvlocalLastPos     = StrFind(svlocalLine, ">");
  1794.             nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  1795.              StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);                         
  1796.             
  1797.  
  1798.       endwhile;
  1799.  
  1800.         CloseFile(nvlocalFileHandle);
  1801.         SRCDIR         = svlocalSaveSourceDir;
  1802.         TARGETDIR     = svlocalSaveTargetDir;           
  1803.  
  1804.     end;
  1805.                                 
  1806. /*---------------------------------------------------------------------------*\
  1807.  *
  1808.  * Function:  CheckRequirements
  1809.  *
  1810.  *  Purpose:  This function will check all minimum requirements for the
  1811.  *            application being installed.  If any fail, then the user
  1812.  *            is informed and the installation is terminated.
  1813.  *
  1814.  *
  1815.  *    Input:
  1816.  *
  1817.  *  Returns:
  1818.  *
  1819.  * Comments:
  1820. \*---------------------------------------------------------------------------*/
  1821.  
  1822. function CheckRequirements()
  1823.     NUMBER nvDx, nvDy;
  1824.     NUMBER nvResult;
  1825.     STRING szResult, szResult2;
  1826.     
  1827.    begin
  1828.  
  1829.         // Determine if target system uses NT or Windows 95.
  1830.       GetSystemInfo( WINMAJOR, nvResult, szResult );
  1831.       bWinNT3x = TRUE;
  1832.       if (nvResult = 4) then
  1833.          bWinNT3x = FALSE; // Running Windows 95.
  1834.       endif;
  1835.  
  1836.         //# COLORS check -------------
  1837.         GetSystemInfo( COLORS, nvResult, szResult );
  1838.         NumToStr(szResult, g_numREQ_MIN_COLORS);
  1839.         if(nvResult < g_numREQ_MIN_COLORS) then
  1840.             MessageBox(g_strCR_ColorMsg1 + szResult + g_strCR_ColorMsg2, INFORMATION);         
  1841.         endif;
  1842.  
  1843.  
  1844.         // CPU check -------------
  1845.         GetSystemInfo( CPU, nvResult, szResult );
  1846.         if(nvResult < g_numREQ_MIN_CPU) then
  1847.             NumToStr(szResult, g_numREQ_MIN_CPU);
  1848.             MessageBox(g_strCR_CPUMsg1 + szResult + g_strCR_CPUMsg2, INFORMATION);      
  1849.         endif;
  1850.  
  1851.         // Check screen resolution.
  1852.         GetExtents( nvDx, nvDy );
  1853.         if (nvDy < 480) then
  1854.             MessageBox( g_strCR_ScreenResolution, WARNING );         
  1855.              exit;
  1856.         endif;
  1857.  
  1858.    end;
  1859.  
  1860. /*---------------------------------------------------------------------------*\
  1861.  *
  1862.  * Function:  CheckSpaceRequirements
  1863.  *
  1864.  *  Purpose:  This function will check space requirements based on the
  1865.  *            elements being installed.
  1866.  *
  1867.  *    Input:    bInclude_Copyset1, bInclude_Copyset2, bInclude_Copyset3,
  1868.  *                    g_numSIZE_REQ_OPTION_1, g_numSIZE_REQ_OPTION_2, 
  1869.  *                    g_numSIZE_REQ_OPTION_3
  1870.  *
  1871.  *  Returns:
  1872.  *
  1873.  * Comments:  For Single Install Option only, this function will only
  1874.  *                use SIZE_REQ_OPTION_1 to determine space required.  
  1875.  *                Then it compares it to the available hard drive space.
  1876.  *              For Multiple Install Options, this function determines which
  1877.  *                install option and calculates the total hard drive space required.
  1878.  *                
  1879. \*---------------------------------------------------------------------------*/
  1880.  
  1881. function CheckSpaceRequirements(    bInclude_Copyset1, 
  1882.                                     bInclude_Copyset2, 
  1883.                                     bInclude_Copyset3,
  1884.                                      szDir )
  1885.         number  nSizeRequired;
  1886.         begin
  1887.  
  1888.           nSizeRequired = 0;
  1889.  
  1890.         // *** DETERMINE TOTAL SIZE OF FILES TO BE INSTALLED ***.
  1891.           if (bInclude_Copyset1) then
  1892.             nSizeRequired = nSizeRequired + g_numSIZE_REQ_OPTION_1;
  1893.           endif; 
  1894.  
  1895.           if (bInclude_Copyset2) then
  1896.             nSizeRequired = nSizeRequired + g_numSIZE_REQ_OPTION_2;
  1897.           endif; 
  1898.  
  1899.           if (bInclude_Copyset3) then
  1900.             nSizeRequired = nSizeRequired + g_numSIZE_REQ_OPTION_3;
  1901.           endif; 
  1902.  
  1903.           // *** CHECK SPACE ON TARGET DRIVE ***
  1904.           bSpaceOk = TRUE;
  1905.           if (GetDiskSpace( szDir ) < nSizeRequired) then
  1906.              szMsg = "There is not enough space available on the disk\n" +
  1907.                      "'" + svMainDirectory + "' \n" +
  1908.                      "Please free up some space or change the target location\n" +
  1909.                      "to a different disk";
  1910.              MessageBeep(0);
  1911.              MessageBox( szMsg, WARNING );
  1912.              bSpaceOk = FALSE;
  1913.           endif;
  1914.  
  1915.           return bSpaceOk;
  1916.         end;
  1917.  
  1918.  
  1919.  
  1920.  
  1921. /*---------------------------------------------------------------------------*\
  1922.  *
  1923.  * Function:      InstallReview()
  1924.  *
  1925.  *  Purpose:      This function will prompt the user to either install the product
  1926.  *                 or review some of their system information that may be helpful to
  1927.  *                technical support.
  1928.  *               
  1929.  * Comments:
  1930. \*---------------------------------------------------------------------------*/
  1931. function InstallReview()
  1932.    NUMBER  nvControl, nvLocalCheck1, nvLocalCheck2;
  1933.    STRING  svLocalMsg, svLocalText1, svLocalText2;
  1934.  
  1935. begin
  1936.  
  1937.    // Provide user with option to install product or review system information
  1938.    nvControl     = EXCLUSIVE;
  1939.    svLocalMsg    = "You may install the program or review your system information.";
  1940.    svLocalText1    = "Install Program";
  1941.    svLocalText2    = "System Information";
  1942.    nvLocalCheck1 = TRUE;
  1943.    nvLocalCheck2 = FALSE;
  1944.  
  1945.    SetDialogTitle( DLG_ASK_OPTIONS, "Options:");
  1946.    Disable( BACKBUTTON );
  1947.    AskOptions(nvControl, svLocalMsg, svLocalText1, nvLocalCheck1, svLocalText2, nvLocalCheck2);
  1948.    Enable( BACKBUTTON );
  1949.  
  1950.    if(nvLocalCheck2 = TRUE) then
  1951.       DetermineOS();               
  1952.       SystemInfo();
  1953.    endif;
  1954.  
  1955. end;
  1956.  
  1957.  
  1958.  
  1959. /*---------------------------------------------------------------------------*\
  1960.  *
  1961.  * Function:  MakeIcons()
  1962.  *
  1963.  *  Purpose:      Creates the group & icon in Win3.x
  1964.  *                      Creates the shortcut in Win95
  1965.  *                      Creates the Personal group & icon in WinNT
  1966.  * 
  1967. \*---------------------------------------------------------------------------*/
  1968.  
  1969. function MakeIcons()
  1970.    STRING   svLocalProgramFolder, svLocalItemName, svLocalCommandLine;
  1971.    STRING   svLocalWorkingDir, svLocalIconPath;
  1972.  
  1973.    BOOL        blocalDone;
  1974.    
  1975.    NUMBER   nvlocalResult, nvlocalFileHandle;
  1976.    NUMBER    nvlocalFirstPos, nvlocalLastPos;
  1977.    NUMBER    nvStrLength;
  1978.       
  1979.       
  1980.    STRING   svlocalFilePath, svlocalFileName;
  1981.    STRING   svlocalLine, svlocalFirstChar;
  1982.    STRING   svTemp; 
  1983.    STRING    svlocalStr;
  1984.      
  1985.     STRING    svlocalGROUP_NAME;
  1986.     STRING    svlocalITEM_NAME;
  1987.     STRING    svlocalAPP_PATH;
  1988.     STRING    svlocalAPP_DIR;
  1989.     STRING    svlocalICON_PATH;
  1990.      
  1991.   
  1992.    begin          
  1993.        blocalDone                    = FALSE;
  1994.    
  1995.        svlocalFilePath    =     SRCDIR; //"";
  1996.        svlocalFileName    =    "Setup.ini";
  1997.  
  1998.        OpenFileMode(FILE_MODE_NORMAL);
  1999.       OpenFile(nvlocalFileHandle, svlocalFilePath, svlocalFileName); 
  2000.       
  2001.       nvlocalResult = 0;
  2002.       while(!blocalDone)
  2003.           nvlocalResult = nvlocalResult + 1; 
  2004.           if(nvlocalResult > g_numMAX_LINES_INI) then
  2005.               blocalDone = TRUE;
  2006.               MessageBox("Setup.ini Error3: not correct line.", INFORMATION);
  2007.           endif;          
  2008.      
  2009.          GetLine(nvlocalFileHandle, svlocalLine);
  2010.             nvlocalFirstPos     = StrFind(svlocalLine, "[") + 1;
  2011.             nvlocalLastPos     = StrFind(svlocalLine, "]");
  2012.             nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2013.              StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);   
  2014.        
  2015.              if( StrCompare(svTemp, "ICONS") = 0) then
  2016.                  blocalDone = TRUE;
  2017.              endif;
  2018.       endwhile;
  2019.                                               //MessageBox("ICONS: " + svlocalLine, INFORMATION);
  2020.  
  2021.         /*  get ICON_INSTALL 0 - no, 1 - yes */        
  2022.       GetLine(nvlocalFileHandle, svlocalLine);
  2023.         nvlocalFirstPos     = StrFind(svlocalLine, "<") + 1;
  2024.         nvlocalLastPos     = StrFind(svlocalLine, ">");
  2025.         nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2026.          StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
  2027.          if(svTemp = "0") then
  2028.              blocalDone = TRUE;
  2029.          else
  2030.              blocalDone = FALSE;
  2031.          endif;       
  2032.          
  2033.       /* this should be the first icon info line */
  2034.       GetLine(nvlocalFileHandle, svlocalLine);
  2035.         nvlocalFirstPos     = StrFind(svlocalLine, "-") + 1;
  2036.         nvlocalLastPos     = StrFind(svlocalLine, "<");
  2037.         nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2038.          StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
  2039.  
  2040.         while(!blocalDone) 
  2041.            SetStatusWindow( 100, "Creating Folder and Icons...." ); 
  2042.  
  2043.             nvlocalFirstPos     = StrFind(svlocalLine, "<") + 1;
  2044.             nvlocalLastPos     = StrFind(svlocalLine, ">");
  2045.             nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2046.              StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);  
  2047.  
  2048.          if(svTemp = "GROUP_NAME") then
  2049.              svlocalGROUP_NAME = svlocalStr;
  2050.                                          //MessageBox("svlocalGROUP_NAME: " + svlocalGROUP_NAME, INFORMATION);
  2051.          elseif(svTemp = "ITEM_NAME") then
  2052.              svlocalITEM_NAME = svlocalStr;
  2053.                                          //MessageBox("svlocalITEM_NAME: " + svlocalITEM_NAME, INFORMATION);            
  2054.          elseif(svTemp = "APP_PATH") then
  2055.                                                  
  2056.                 nvlocalFirstPos     = StrFind(svlocalLine, "<") + 1;
  2057.                 nvlocalLastPos     = StrFind(svlocalLine, "\\");
  2058.                 nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2059.                  StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);
  2060.                  
  2061.                  if(svlocalStr = "TARGETDIR") then
  2062.                      svlocalAPP_DIR = TARGETDIR;
  2063.                      
  2064.                      svlocalAPP_PATH = svlocalAPP_DIR; 
  2065.  
  2066.                     nvlocalFirstPos     = StrFind(svlocalLine, "\\") + 1;
  2067.                     nvlocalLastPos     = StrFind(svlocalLine, ">");
  2068.                     nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2069.                      StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);                     
  2070.                      
  2071.                      svlocalAPP_PATH = svlocalAPP_DIR + svlocalStr; 
  2072.                      
  2073.                  endif;
  2074.  
  2075.  
  2076.          elseif(svTemp = "ICON_PATH") then
  2077.             if(svlocalStr = "NULL") then
  2078.                   svlocalICON_PATH = "";
  2079.               else
  2080.                   svlocalICON_PATH = svlocalStr;
  2081.               endif;
  2082.  
  2083.                   if(bWin95 || bWinNT3x || bWinNT40) then      
  2084.                        LongPathToQuote(svlocalAPP_PATH, TRUE);        // adds quotes to a long file name
  2085.                   endif;                
  2086.                                             
  2087.               AddFolderIcon(    svlocalGROUP_NAME, svlocalITEM_NAME, svlocalAPP_PATH,
  2088.                                       svlocalAPP_DIR, svlocalICON_PATH, 0, "", REPLACE ); 
  2089.             else
  2090.              blocalDone = TRUE;
  2091.          endif; 
  2092.          
  2093.           /* get the next line */
  2094.           GetLine(nvlocalFileHandle, svlocalLine);
  2095.             nvlocalFirstPos     = StrFind(svlocalLine, "-") + 1;
  2096.             nvlocalLastPos     = StrFind(svlocalLine, "<");
  2097.             nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2098.              StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);                      
  2099.       endwhile;
  2100.  
  2101.     CloseFile(nvlocalFileHandle);
  2102.  
  2103. end;
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118. /*---------------------------------------------------------------------------*\
  2119.  *
  2120.  * Function:  WriteTextFile()
  2121.  *
  2122.  *  Purpose:    This function will write to the specified text based file.
  2123.  *                
  2124.  *    Input:    
  2125.  *
  2126.  *  Returns:
  2127.  *
  2128.  * Comments:    Normally the text file written is the .INI file.        
  2129.  *                Verify that this section writes the file to the proper directory 
  2130.  *              
  2131.  *                
  2132. \*---------------------------------------------------------------------------*/
  2133.  
  2134. function WriteTextFile()
  2135.  
  2136.    NUMBER   nvLocalResult, nvlocalMakeTextFileHandle;
  2137.    STRING   svlocalMakeTextFilePath, svlocalMakeTextFileName;
  2138.    STRING   svLocalMECCString;
  2139.    
  2140.    BOOL        blocalDone;
  2141.    BOOL        blocalCreateTextFile;
  2142.    
  2143.    NUMBER   nvlocalResult, nvlocalFileHandle;
  2144.    NUMBER    nvlocalFirstPos, nvlocalLastPos;
  2145.    NUMBER    nvStrLength;
  2146.  
  2147.    STRING   svlocalFilePath, svlocalFileName;
  2148.    STRING   svlocalLine, svlocalFirstChar;
  2149.    STRING   svTemp; 
  2150.      STRING    svlocalBuildPath;
  2151.   
  2152.    begin          
  2153.        blocalDone                        = FALSE;
  2154.        blocalCreateTextFile            = FALSE;
  2155.    
  2156.        svlocalFilePath    =     SRCDIR; //"";
  2157.        svlocalFileName    =    "Setup.ini";
  2158.    
  2159.        OpenFileMode(FILE_MODE_NORMAL);
  2160.       OpenFile(nvlocalFileHandle, svlocalFilePath, svlocalFileName); 
  2161.       
  2162.       nvlocalResult = 0;
  2163.       while(!blocalDone)
  2164.           nvlocalResult = nvlocalResult + 1; 
  2165.           if(nvlocalResult > g_numMAX_LINES_INI) then
  2166.               blocalDone = TRUE;
  2167.               MessageBox("Setup.ini Error4: not correct line.", INFORMATION);
  2168.           endif; 
  2169.      
  2170.          GetLine(nvlocalFileHandle, svlocalLine);
  2171.             nvlocalFirstPos     = StrFind(svlocalLine, "[") + 1;
  2172.             nvlocalLastPos     = StrFind(svlocalLine, "]");
  2173.             nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2174.              StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);   
  2175.                      
  2176.              if( StrCompare(svTemp, "TEXT FILE INFO") = 0) then
  2177.                  blocalDone = TRUE;
  2178.              endif;
  2179.       endwhile; 
  2180.  
  2181.         /*  ********************* get    TEXT_FILE_USED    // 0 - no, 1 - yes ************************ */        
  2182.       GetLine(nvlocalFileHandle, svlocalLine);
  2183.         nvlocalFirstPos     = StrFind(svlocalLine, "<") + 1;
  2184.         nvlocalLastPos     = StrFind(svlocalLine, ">");
  2185.         nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2186.          StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
  2187.          if(svTemp = "0") then
  2188.              blocalCreateTextFile = FALSE;
  2189.          else
  2190.              blocalCreateTextFile = TRUE;
  2191.          endif; 
  2192.                                                                                                                 //MessageBox("TEXT_FILE_USED: " + svTemp, INFORMATION);      
  2193.       if(blocalCreateTextFile) then    
  2194.          
  2195.          /*  ********************* get    TEXT_NAME:name of file to create************************ */
  2196.           GetLine(nvlocalFileHandle, svlocalLine);
  2197.             nvlocalFirstPos     = StrFind(svlocalLine, "<") + 1;
  2198.             nvlocalLastPos     = StrFind(svlocalLine, ">");
  2199.             nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2200.              StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);        
  2201.  
  2202.             svlocalMakeTextFileName = svTemp;
  2203.          OpenFileMode(FILE_MODE_APPEND);
  2204.          
  2205.          /*  ********************* get    PATH:location file is to be created at.***************** */
  2206.           GetLine(nvlocalFileHandle, svlocalLine);
  2207.             nvlocalFirstPos     = StrFind(svlocalLine, "<") + 1;
  2208.             nvlocalLastPos     = StrFind(svlocalLine, ">");
  2209.             nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2210.              StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);         
  2211.          
  2212.          if(svTemp = "WINDIR") then
  2213.              svlocalMakeTextFilePath = WINDIR;
  2214.                                                                          //MessageBox("WINDIR: " + svlocalMakeTextFilePath, INFORMATION);
  2215.          elseif(svTemp = "WINSYSDIR") then
  2216.             svlocalMakeTextFilePath = WINSYSDIR;
  2217.                                                                          //MessageBox("WINSYSDIR: " + svlocalMakeTextFilePath, INFORMATION);            
  2218.          elseif(svTemp = "TARGETDIR") then
  2219.             svlocalMakeTextFilePath = svMainDirectory;
  2220.                                                                          //MessageBox("TARGETDIR: " + svlocalMakeTextFilePath, INFORMATION);            
  2221.          endif;
  2222.          
  2223.          
  2224.          if(CreateFile(nvlocalMakeTextFileHandle, svlocalMakeTextFilePath, svlocalMakeTextFileName) < 0) then
  2225.              //MessageBox("could not be created", INFORMATION);
  2226.          endif;
  2227.          blocalDone = FALSE;
  2228.           while(!blocalDone)
  2229.               nvlocalResult = nvlocalResult + 1; 
  2230.               if(nvlocalResult > g_numMAX_LINES_INI) then
  2231.                   blocalDone = TRUE;
  2232.                   MessageBox("Setup.ini Error5: not correct line.", INFORMATION);
  2233.               endif; 
  2234.      
  2235.              GetLine(nvlocalFileHandle, svlocalLine);
  2236.                 nvlocalFirstPos     = StrFind(svlocalLine, "-") + 1;
  2237.                 nvlocalLastPos     = StrFind(svlocalLine, "<");
  2238.                 nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2239.                  StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);   
  2240.                      
  2241.                  if( StrCompare(svTemp, "LINE") = 0) then
  2242.                      blocalDone = TRUE;
  2243.                  elseif( StrCompare(svTemp, "PATH") = 0) then
  2244.                      blocalDone = TRUE;
  2245.                  endif;
  2246.           endwhile;
  2247.  
  2248.  
  2249.          blocalDone = FALSE;
  2250.           while(!blocalDone)
  2251.  
  2252.                                                              //MessageBox("Current Line" + svTemp, INFORMATION);
  2253.              if(svTemp = "LINE") then
  2254.                     nvlocalFirstPos     = StrFind(svlocalLine, "<") + 1;
  2255.                     nvlocalLastPos     = StrFind(svlocalLine, ">");
  2256.                     nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2257.                      StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);         
  2258.                  WriteLine(nvlocalMakeTextFileHandle, svTemp);
  2259.              elseif(svTemp = "PATH") then
  2260.                 svlocalBuildPath = "";
  2261.                     nvlocalFirstPos     = StrFind(svlocalLine, "<") + 1;
  2262.                     nvlocalLastPos     = StrFind(svlocalLine, "=") + 1;
  2263.                     nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2264.                      StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength); 
  2265.                      
  2266.                      svlocalBuildPath = svlocalBuildPath + svTemp; 
  2267.  
  2268.                     nvlocalFirstPos     = StrFind(svlocalLine, "=") + 1;
  2269.                     nvlocalLastPos     = StrFind(svlocalLine, "\\");
  2270.                     nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2271.                      StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);                      
  2272.  
  2273.                      if(svTemp = "SRCDIR") then
  2274.                          svlocalBuildPath = svlocalBuildPath + SRCDIR;
  2275.                      elseif(svTemp = "SRCDISK") then
  2276.                          svlocalBuildPath = svlocalBuildPath + SRCDISK;
  2277.                      elseif(svTemp = "TARGETDIR") then 
  2278.                          svlocalBuildPath = svlocalBuildPath + TARGETDIR;
  2279.                      elseif(svTemp = "WINDIR") then
  2280.                          svlocalBuildPath = svlocalBuildPath + WINDIR;                     
  2281.                      else //WINSYSDIR
  2282.                          svlocalBuildPath = svlocalBuildPath + WINSYSDIR;                     
  2283.                      endif;
  2284.                      
  2285.                     nvlocalFirstPos     = StrFind(svlocalLine, "\\") + 1;
  2286.                     nvlocalLastPos     = StrFind(svlocalLine, ">");
  2287.                     nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2288.                      StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);                     
  2289.                      svlocalBuildPath = svlocalBuildPath + svTemp;   
  2290.                                                                  //MessageBox("PATH: " + svlocalBuildPath, INFORMATION);
  2291.                  WriteLine(nvlocalMakeTextFileHandle, svlocalBuildPath);
  2292.              else
  2293.                  blocalDone = TRUE;
  2294.              endif;
  2295.              
  2296.              GetLine(nvlocalFileHandle, svlocalLine);
  2297.                 nvlocalFirstPos     = StrFind(svlocalLine, "-") + 1;
  2298.                 nvlocalLastPos     = StrFind(svlocalLine, "<");
  2299.                 nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2300.                  StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);              
  2301.              
  2302.             endwhile;
  2303.          
  2304.          CloseFile(nvlocalMakeTextFileHandle);
  2305.       endif;
  2306.  
  2307. end;
  2308.  
  2309. /*---------------------------------------------------------------------------*\
  2310.  *
  2311.  * Function:  Additional_Registry_Info
  2312.  *
  2313.  *  Purpose:  This function will create necessary keys and values in
  2314.  *            the Registry for Windows 95 and Windows NT
  2315.  *
  2316.  *    Input:  
  2317.  *
  2318.  *  Returns:
  2319.  *
  2320. \*---------------------------------------------------------------------------*/
  2321.  
  2322. function Additional_Registry_Info()
  2323.  
  2324.    BOOL        blocalDone;
  2325.  
  2326.    STRING   svTemp; 
  2327.    STRING    svlocalStr;
  2328.      
  2329.      STRING    svlocalROOT_KEY;
  2330.      STRING    svlocalKEY;
  2331.      STRING    svlocalKEY_NAME;
  2332.      
  2333.    begin                                                       
  2334.       OpenSetupFile();
  2335.       // *************************** [REGISTRY KEY INFO] *************************************
  2336.         FindLine("[", "]", "REGISTRY KEY INFO");
  2337.         GetNextLine( "<", ">" );
  2338.       svTemp = svglobalReturnStr;
  2339.                                               //MessageBox("Add reg 0-1: " + svTemp, INFORMATION); 
  2340.         blocalDone = FALSE;
  2341.         if(svTemp = "0") then
  2342.             blocalDone = TRUE;
  2343.         endif;
  2344.          
  2345.         GetNextLine( "-", "<" );
  2346.       svTemp = svglobalReturnStr;
  2347.                                               //MessageBox("Line: " + svTemp, INFORMATION);         
  2348.         while(!blocalDone)
  2349.              
  2350.             GetCurrentLine( "<", ">" );
  2351.           svlocalStr = svglobalReturnStr;
  2352.                                               //MessageBox("svlocalStrLine: " + svlocalStr, INFORMATION);             
  2353.                      
  2354.           if(svTemp = "ROOT_KEY") then
  2355.                  
  2356.                  svlocalROOT_KEY = svlocalStr;              
  2357.                                                              //MessageBox("ROOT_KEY: " + svlocalLine, INFORMATION); 
  2358.              if(svlocalROOT_KEY = "HKEY_CLASSES_ROOT") then
  2359.                     RegDBSetDefaultRoot( HKEY_CLASSES_ROOT );
  2360.              elseif(svlocalROOT_KEY = "HKEY_CURRENT_USER") then
  2361.                     RegDBSetDefaultRoot( HKEY_CURRENT_USER );
  2362.              elseif(svlocalROOT_KEY = "HKEY_LOCAL_MACHINE") then
  2363.                     RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );                 
  2364.              elseif(svlocalROOT_KEY = "HKEY_USERS") then    
  2365.                     RegDBSetDefaultRoot( HKEY_USERS );                 
  2366.              elseif(svlocalROOT_KEY = "HKEY_CURRENT_CONFIG") then
  2367.                     RegDBSetDefaultRoot( HKEY_CURRENT_CONFIG );                 
  2368.              elseif(svlocalROOT_KEY = "HKEY_DYN_DATA") then 
  2369.                     RegDBSetDefaultRoot( HKEY_DYN_DATA );                 
  2370.              endif;             
  2371.                  
  2372.              elseif(svTemp = "KEY") then
  2373.                  
  2374.                  svlocalKEY = svlocalStr;                               
  2375.             RegDBCreateKeyEx( svlocalKEY, "" );
  2376.                                                              //MessageBox("KEY: " + svlocalLine, INFORMATION);
  2377.              elseif(svTemp = "KEY_NAME") then
  2378.  
  2379.                  svlocalKEY_NAME = svlocalStr;
  2380.                                                              //MessageBox("KEY_NAME: " + svlocalLine, INFORMATION);             
  2381.              elseif(svTemp = "REGDB_STRING") then 
  2382.                 if(svlocalStr = "SRCDIR") then
  2383.                    RegDBSetKeyValueEx( svlocalKEY, svlocalKEY_NAME, REGDB_STRING, SRCDIR, -1 );                
  2384.                 elseif(svlocalStr = "TARGETDIR") then
  2385.                     RegDBSetKeyValueEx( svlocalKEY, svlocalKEY_NAME, REGDB_STRING, TARGETDIR, -1 );               
  2386.                 elseif(svlocalStr = "WINDIR") then
  2387.                     RegDBSetKeyValueEx( svlocalKEY, svlocalKEY_NAME, REGDB_STRING, WINDIR, -1 );
  2388.                 elseif(svlocalStr = "WINSYSDIR") then
  2389.                    RegDBSetKeyValueEx( svlocalKEY, svlocalKEY_NAME, REGDB_STRING, WINSYSDIR, -1 );                
  2390.                 else
  2391.                    RegDBSetKeyValueEx( svlocalKEY, svlocalKEY_NAME, REGDB_STRING, svlocalStr, -1 );
  2392.                 endif;            
  2393.                                                     //MessageBox("REGDB_STRING: " + svlocalLine, INFORMATION);
  2394.           elseif(svTemp = "REGDB_NUMBER") then
  2395.               RegDBSetKeyValueEx( svlocalKEY, svlocalKEY_NAME, REGDB_NUMBER, svlocalStr, -1 );                              
  2396.                                                     //MessageBox("REGDB_NUMBER: " + svlocalLine, INFORMATION);
  2397.              else
  2398.                  blocalDone = TRUE;
  2399.              endif;
  2400.              
  2401.             GetNextLine( "-", "<" );
  2402.           svTemp = svglobalReturnStr;
  2403.                                               //MessageBox("nextLine: " + svTemp, INFORMATION);             
  2404.         endwhile;
  2405.         
  2406.         CloseSetupFile();
  2407.     end;
  2408.  
  2409. /*---------------------------------------------------------------------------*\
  2410.  *
  2411.  * Function:  CreateRegDBEntries
  2412.  *
  2413.  *  Purpose:  This function will create necessary keys and values in
  2414.  *            the Registry for Windows 95 and Windows NT
  2415.  *
  2416.  *    Input:  EXTENTION_USED, EXTENTION, TARGETDIR
  2417.  *
  2418.  *  Returns:
  2419.  *
  2420.  * Comments:  Edit these function as needed.
  2421. \*---------------------------------------------------------------------------*/
  2422.  
  2423. function CreateRegDBEntries()
  2424.         string szKey[255], szValue, szDemo, szProgram;
  2425.         STRING szName, svTemp, svRegStr, svRegKeyName;
  2426.         NUMBER nRegReturn, nvType, nRegValue;
  2427. begin
  2428.    // *** CREATE FILE EXTENTION ENTRIES (SAVED GAME) IN REGISTRY: HKEY_CLASSES_ROOT ***
  2429.  
  2430.    if(g_numEXTENSION_USED = 1) then
  2431.  
  2432.       RegDBSetDefaultRoot( HKEY_CLASSES_ROOT );  
  2433.       szKey = "." + g_strEXTENSION;                            // Example: szKey = ".ot2";
  2434.       RegDBCreateKeyEx( szKey, "" );
  2435.       svTemp = g_strEXTENSION + "file";
  2436.       RegDBSetKeyValueEx( szKey, "", REGDB_STRING, svTemp, -1 ); 
  2437.       // Example:  RegDBSetKeyValueEx( szKey, "", REGDB_STRING, "ot2file", -1 );
  2438.  
  2439.       RegDBSetDefaultRoot( HKEY_CLASSES_ROOT ); 
  2440.       szKey = g_strEXTENSION + "file";                          // Example: szKey = "ot2file";
  2441.       RegDBCreateKeyEx( szKey, "" );  
  2442.  
  2443.       RegDBSetDefaultRoot( HKEY_CLASSES_ROOT );
  2444.       szKey = g_strEXTENSION + "file\\DefaultIcon";          // Example: szKey = "ot2file\\DefaultIcon"
  2445.       RegDBCreateKeyEx( szKey, "" );
  2446.    
  2447.       // *** USES USER DEFINED TARGET DIRECTORY ***
  2448.       szProgram = TARGETDIR + szApplicationName + ",1";  //TARGETDIR ^ "\\africa32.EXE,1";    
  2449.       // Example: szProgram = TARGETDIR ^ "\\OTII32.EXE,1"
  2450.       RegDBSetKeyValueEx( szKey, "", REGDB_STRING, szProgram, -1 ); 
  2451.  
  2452.       RegDBSetDefaultRoot( HKEY_CLASSES_ROOT ); 
  2453.       szKey = g_strEXTENSION + "file\\shell";      //"afrfile\\shell";
  2454.                                         // Example: szKey = "plafile\\shell"; 
  2455.       RegDBCreateKeyEx( szKey, "" );  
  2456.  
  2457.       RegDBSetDefaultRoot( HKEY_CLASSES_ROOT ); 
  2458.       szKey = g_strEXTENSION + "file\\shell\\open";            //"afrfile\\shell\\open"; 
  2459.       // Example: szKey = "plafile\\shell\\open";
  2460.       RegDBCreateKeyEx( szKey, "" );     
  2461.  
  2462.       szKey = g_strEXTENSION + "file\\shell\\open\\command";  //"afrfile\\shell\\open\\command"; 
  2463.       RegDBCreateKeyEx( szKey, "" );
  2464.       
  2465.       
  2466.       szProgram = TARGETDIR + szApplicationName + ' "%1"'; // %1 refers to which icon to display
  2467.       if(bWin95) then
  2468.       //     LongPathToQuote( szProgram, TRUE );
  2469.       endif;
  2470.       RegDBSetKeyValueEx( szKey, "", REGDB_STRING, szProgram, -1 );
  2471.  
  2472.    endif;
  2473.  
  2474.    // *** CREATE ENTRIES IN REGISTRY: HKEY_LOCAL_MACHINE ***
  2475.    RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );                         
  2476.    szKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\" + g_strPRODUCT_NAME;
  2477.    
  2478.    // *** QUESTION What do these line do?
  2479.    if(bWin95) then        
  2480. //      LongPathToQuote( szKey, TRUE );
  2481.    endif;
  2482.    RegDBCreateKeyEx( szKey, "" );
  2483.    RegDBSetKeyValueEx( szKey, "", REGDB_STRING, svMainDirectory, -1 );  
  2484.         
  2485.        
  2486. end; 
  2487.  
  2488.  
  2489.  
  2490.  
  2491. /* -------------------------------------------------------------------------*\
  2492.  * Function:    Load_Message_Strings()
  2493.  *
  2494.  *  Purpose:    To copy the messages in the Setup.ini file to the installer.
  2495.  *
  2496.  *    Input:    
  2497.  *
  2498.  *  Returns:
  2499.  *
  2500.  * Comments:      
  2501. \* -------------------------------------------------------------------------*/                                
  2502. function Load_Message_Strings()
  2503.      
  2504.       begin
  2505.           OpenSetupFile();
  2506.  
  2507.         FindLine("[", "]", "MESSAGE STRINGS");
  2508.         GetNextLine( "<", ">" );
  2509.         // ********************************************************** function:<SetupScreen>
  2510.         GetNextLine( "<", ">" );
  2511.       g_strSS_SetTitle = svglobalReturnStr;
  2512.                                               //MessageBox("g_strSS_SetTitle: " + svglobalReturnStr, INFORMATION);  
  2513.                                               
  2514.  
  2515.         GetNextLine( "<", ">" );
  2516.         // ********************************************************** function:<System Info>
  2517.         GetNextLine( "<", ">" );
  2518.       g_strSI_Title = svglobalReturnStr;
  2519.                                               //MessageBox("g_strSI_Title: " + svglobalReturnStr, INFORMATION);  
  2520.         GetNextLine( "<", ">" );
  2521.       g_strSI_Msg = svglobalReturnStr;
  2522.                                               //MessageBox("g_strSI_Msg: " + svglobalReturnStr, INFORMATION);  
  2523.         GetNextLine( "<", ">" );
  2524.       g_strSI_System = svglobalReturnStr;
  2525.                                               //MessageBox("g_strSI_System: " + svglobalReturnStr, INFORMATION);
  2526.         GetNextLine( "<", ">" );
  2527.       g_strSI_CPU = svglobalReturnStr;
  2528.                                               //MessageBox("g_strSI_CPU: " + svglobalReturnStr, INFORMATION);  
  2529.         GetNextLine( "<", ">" );
  2530.       g_strSI_MEM = svglobalReturnStr;
  2531.                                               //MessageBox("g_strSI_MEM: " + svglobalReturnStr, INFORMATION);  
  2532.         GetNextLine( "<", ">" );
  2533.       g_strSI_BASEMEM = svglobalReturnStr;
  2534.                                               //MessageBox("g_strSI_BASEMEM: " + svglobalReturnStr, INFORMATION);  
  2535.         GetNextLine( "<", ">" );
  2536.       g_strSI_EXTENDEDMEM = svglobalReturnStr;
  2537.                                               //MessageBox("g_strSI_EXTENDEDMEM: " + svglobalReturnStr, INFORMATION);  
  2538.         GetNextLine( "<", ">" );
  2539.       g_strSI_VIDEO = svglobalReturnStr;
  2540.                                               //MessageBox("g_strSI_VIDEO: " + svglobalReturnStr, INFORMATION);  
  2541.         GetNextLine( "<", ">" );
  2542.       g_strSI_COLORS = svglobalReturnStr;
  2543.                                               //MessageBox("g_strSI_COLORS: " + svglobalReturnStr, INFORMATION);  
  2544.         GetNextLine( "<", ">" );
  2545.       g_strSI_Resolution = svglobalReturnStr;
  2546.                                               //MessageBox("g_strSI_Resolution: " + svglobalReturnStr, INFORMATION);  
  2547.         GetNextLine( "<", ">" );
  2548.       g_strSI_Unknown = svglobalReturnStr;
  2549.                                               //MessageBox("g_strSI_Unknown: " + svglobalReturnStr, INFORMATION);  
  2550.         GetNextLine( "<", ">" );
  2551.       g_strSI_Beyond = svglobalReturnStr;
  2552.                                               //MessageBox("g_strSI_Beyond: " + svglobalReturnStr, INFORMATION);  
  2553.         GetNextLine( "<", ">" );
  2554.       g_strSI_VideoDrTypMsg = svglobalReturnStr;
  2555.                                               //MessageBox("g_strSI_VideoDrTypMsg: " + svglobalReturnStr, INFORMATION);  
  2556.         GetNextLine( "<", ">" );
  2557.       g_strSI_VideoTypMsg = svglobalReturnStr;
  2558.                                               //MessageBox("g_strSI_VideoTypMsg: " + svglobalReturnStr, INFORMATION);  
  2559.         GetNextLine( "<", ">" );
  2560.       g_strSI_MidiDrTypMsg = svglobalReturnStr;
  2561.                                               //MessageBox("g_strSI_MidiDrTypMsg: " + svglobalReturnStr, INFORMATION);  
  2562.         GetNextLine( "<", ">" );
  2563.       g_strSI_MULTIMEDMSG = svglobalReturnStr;
  2564.                                               //MessageBox("g_strSI_MULTIMEDMSG: " + svglobalReturnStr, INFORMATION);  
  2565.         GetNextLine( "<", ">" );
  2566.       g_strSI_Detected = svglobalReturnStr;
  2567.                                               //MessageBox("g_strSI_Detected: " + svglobalReturnStr, INFORMATION);  
  2568.         GetNextLine( "<", ">" );
  2569.       g_strSI_NotDetected = svglobalReturnStr;
  2570.                                               //MessageBox("g_strSI_NotDetected: " + svglobalReturnStr, INFORMATION);  
  2571.         GetNextLine( "<", ">" );
  2572.       g_strSI_Avi = svglobalReturnStr;
  2573.                                               //MessageBox("g_strSI_Avi: " + svglobalReturnStr, INFORMATION);  
  2574.         GetNextLine( "<", ">" );
  2575.       g_strSI_QTW = svglobalReturnStr;
  2576.                                               //MessageBox("g_strSI_QTW: " + svglobalReturnStr, INFORMATION);  
  2577.         GetNextLine( "<", ">" );
  2578.       g_strSI_Wave = svglobalReturnStr;
  2579.                                               //MessageBox("g_strSI_Wave: " + svglobalReturnStr, INFORMATION);  
  2580.         GetNextLine( "<", ">" );
  2581.       g_strSI_DriveInfo = svglobalReturnStr;
  2582.                                               //MessageBox("g_strSI_DriveInfo: " + svglobalReturnStr, INFORMATION);  
  2583.         GetNextLine( "<", ">" );
  2584.       g_strSI_CDROM = svglobalReturnStr;
  2585.                                               //MessageBox("g_strSI_CDROM: " + svglobalReturnStr, INFORMATION);  
  2586.         GetNextLine( "<", ">" );
  2587.       g_strSI_DrTypeFixed = svglobalReturnStr;
  2588.                                               //MessageBox("g_strSI_DrTypeFixed: " + svglobalReturnStr, INFORMATION);  
  2589.         GetNextLine( "<", ">" );
  2590.       g_strSI_DrTypeRemov = svglobalReturnStr;
  2591.                                               //MessageBox("g_strSI_DrTypeRemov: " + svglobalReturnStr, INFORMATION);  
  2592.         GetNextLine( "<", ">" );
  2593.       g_strSI_DrTypeRemote = svglobalReturnStr;
  2594.                                               //MessageBox("g_strSI_DrTypeRemote: " + svglobalReturnStr, INFORMATION);  
  2595.         GetNextLine( "<", ">" );
  2596.       g_strSI_FreeSpace = svglobalReturnStr;
  2597.                                               //MessageBox("g_strSI_FreeSpace: " + svglobalReturnStr, INFORMATION);  
  2598.         GetNextLine( "<", ">" );
  2599.       g_strSI_MB = svglobalReturnStr;
  2600.                                               //MessageBox("g_strSI_MB: " + svglobalReturnStr, INFORMATION);  
  2601.                                               
  2602.                                               
  2603.                                                             
  2604.         GetNextLine( "<", ">" );
  2605.         // ******************************************* function:<CompressedFileTransferList>
  2606.         GetNextLine( "<", ">" );
  2607.       g_strCFTL_SetStatusWindowMsg = svglobalReturnStr;
  2608.                                               //MessageBox("g_strCFTL_SetStatusWindowMsg: " + svglobalReturnStr, INFORMATION); 
  2609.  
  2610.       GetNextLine( "<", ">" );
  2611.       // ******************************************* function:<Multiple_Installation_Options>
  2612.         GetNextLine( "<", ">" );
  2613.       g_strMIO_SetupType = svglobalReturnStr;
  2614.                                               //MessageBox("g_strMIO_SetupType: " + svglobalReturnStr, INFORMATION);                
  2615.         GetNextLine( "<", ">" );
  2616.       g_strMIO_SetDialogTitle = svglobalReturnStr;
  2617.                                               //MessageBox("g_strMIO_SetDialogTitle: " + svglobalReturnStr, INFORMATION);           
  2618.         GetNextLine( "<", ">" );
  2619.       g_strMIO_AskOptionsMessage = svglobalReturnStr;
  2620.                                               //MessageBox("g_strMIO_AskOptionsMessage: " + svglobalReturnStr, INFORMATION);          
  2621.         GetNextLine( "<", ">" );
  2622.       g_strMIO_AskOptionsDescription1 = svglobalReturnStr;
  2623.                                               //MessageBox("g_strMIO_AskOptionsDescription1: " + svglobalReturnStr, INFORMATION);         
  2624.         GetNextLine( "<", ">" );
  2625.       g_strMIO_AskOptionsDescription2 = svglobalReturnStr;
  2626.                                               //MessageBox("g_strMIO_AskOptionsDescription2: " + svglobalReturnStr, INFORMATION);                                                                                                     
  2627.         GetNextLine( "<", ">" );
  2628.       g_strMIO_AskOptionsDescription3 = svglobalReturnStr;
  2629.                                               //MessageBox("g_strMIO_AskOptionsDescription3: " + svglobalReturnStr, INFORMATION);
  2630.                                               
  2631.                                               
  2632.  
  2633.       GetNextLine( "<", ">" );
  2634.       // ******************************************* function:<CheckRequirements>
  2635.         GetNextLine( "<", ">" );
  2636.       g_strCR_ColorMsg1 = svglobalReturnStr;
  2637.                                               //MessageBox("g_strCR_ColorMsg1: " + svglobalReturnStr, INFORMATION);                
  2638.         GetNextLine( "<", ">" );
  2639.       g_strCR_ColorMsg2 = svglobalReturnStr;
  2640.                                               //MessageBox("g_strCR_ColorMsg2: " + svglobalReturnStr, INFORMATION);           
  2641.         GetNextLine( "<", ">" );
  2642.       g_strCR_CPUMsg1 = svglobalReturnStr;
  2643.                                               //MessageBox("g_strCR_CPUMsg2: " + svglobalReturnStr, INFORMATION);          
  2644.         GetNextLine( "<", ">" );
  2645.       g_strMIO_AskOptionsDescription1     = svglobalReturnStr;
  2646.                                               //MessageBox("g_strMIO_AskOptionsDescription1: " + svglobalReturnStr, INFORMATION);         
  2647.         GetNextLine( "<", ">" );
  2648.       g_strCR_ScreenResolution             = svglobalReturnStr;
  2649.                                               //MessageBox("g_strCR_ScreenResolution: " + svglobalReturnStr, INFORMATION);                                                                                                     
  2650.                                                           
  2651.  
  2652.         CloseSetupFile();                                              
  2653.     end;
  2654.  
  2655.  
  2656. /*---------------------------------------------------------------------------*\
  2657.  *
  2658.  * Function:  OpenSetupFile
  2659.  *
  2660.  *  Purpose:  Opens the Setup.ini file.
  2661.  *
  2662.  *    Input:  
  2663.  *
  2664.  *  Returns:
  2665.  *
  2666.  * Comments:  
  2667. \*---------------------------------------------------------------------------*/
  2668.  
  2669. function OpenSetupFile()
  2670.  
  2671. begin
  2672.     svglobalFilePath    =     SRCDIR;
  2673.    svglobalFileName    =    "Setup.ini";
  2674.  
  2675.    OpenFileMode(FILE_MODE_NORMAL);
  2676.    OpenFile(nglobalFileHandle, svglobalFilePath, svglobalFileName); 
  2677.  
  2678. end;
  2679.  
  2680.  
  2681.  
  2682.  
  2683. /*---------------------------------------------------------------------------*\
  2684.  *
  2685.  * Function:  CloseSetupFile
  2686.  *
  2687.  *  Purpose:  Closes the Setup.ini file.
  2688.  *
  2689.  *    Input:  
  2690.  *
  2691.  *  Returns:
  2692.  *
  2693.  * Comments:  
  2694. \*---------------------------------------------------------------------------*/
  2695.  
  2696. function CloseSetupFile()
  2697.  
  2698. begin
  2699.    CloseFile(nglobalFileHandle);
  2700. end;
  2701.  
  2702.  
  2703. /*---------------------------------------------------------------------------*\
  2704.  *
  2705.  * Function:  FindLine( string, string, string );
  2706.  *
  2707.  *  Purpose:  Closes the Setup.ini file.
  2708.  *
  2709.  *    Input:  
  2710.  *
  2711.  *  Returns:
  2712.  *
  2713.  * Comments:  
  2714. \*---------------------------------------------------------------------------*/
  2715.  
  2716. function FindLine( svFirstChar, svLastChar, svFindStr )
  2717.     BOOL        blocalDone;
  2718.  
  2719.    NUMBER    nvlocalFirstPos;
  2720.    NUMBER    nvlocalLastPos;
  2721.    NUMBER    nvStrLength;
  2722.    NUMBER    nvLineNum;
  2723.    
  2724.     STRING     svlocalLine;
  2725.    
  2726.     begin               
  2727.         blocalDone     = FALSE;
  2728.         nvLineNum     = 0;
  2729.       
  2730.         while(!blocalDone)
  2731.            nvLineNum = nvLineNum + 1; 
  2732.           if(nvLineNum > g_numMAX_LINES_INI) then
  2733.               blocalDone = TRUE;
  2734.               MessageBox("FindLine Setup.ini Error: not correct line.", INFORMATION);
  2735.           endif;         
  2736.                    
  2737.           GetLine(nglobalFileHandle, svlocalLine);
  2738.             nvlocalFirstPos     = StrFind(svlocalLine, svFirstChar) + 1;
  2739.             nvlocalLastPos     = StrFind(svlocalLine, svLastChar);
  2740.             nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2741.               StrSub(svglobalReturnStr, svlocalLine, nvlocalFirstPos, nvStrLength);
  2742.               
  2743.                    //MessageBox("svglobalReturnStr: " + svglobalReturnStr + "   svlocalLine: " + svlocalLine, INFORMATION);
  2744.              if( StrCompare(svglobalReturnStr, svFindStr) = 0) then
  2745.                  blocalDone = TRUE;
  2746.              endif;
  2747.       endwhile;      
  2748.        
  2749.     end; 
  2750.                                                     
  2751.  
  2752. /*---------------------------------------------------------------------------*\
  2753.  *
  2754.  * Function:  GetNextLine( svFirstChar, svLastChar );
  2755.  *
  2756.  *  Purpose:  Sets svglobalReturnStr to be the string that is bound by 
  2757.  *            svFirstChar, svLastChar. Sets svglobalLineStr to the current line.
  2758.  *
  2759.  *    Input:  svFirstChar, svLastChar  
  2760.  *
  2761.  *  Returns:
  2762.  *
  2763.  * Comments:  
  2764. \*---------------------------------------------------------------------------*/
  2765.  
  2766. function GetNextLine( svFirstChar, svLastChar )
  2767.  
  2768.    NUMBER    nvlocalFirstPos;
  2769.    NUMBER    nvlocalLastPos;
  2770.    NUMBER    nvStrLength;
  2771.  
  2772.     begin               
  2773.                    
  2774.       GetLine(nglobalFileHandle, svglobalLineStr);
  2775.         nvlocalFirstPos     = StrFind(svglobalLineStr, svFirstChar) + 1;
  2776.         nvlocalLastPos     = StrFind(svglobalLineStr, svLastChar);
  2777.         nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2778.         StrSub(svglobalReturnStr, svglobalLineStr, nvlocalFirstPos, nvStrLength);   
  2779.     
  2780.     end; 
  2781.  
  2782.  
  2783.  
  2784. /*---------------------------------------------------------------------------*\
  2785.  *
  2786.  * Function:  GetCurrentLine( svFirstChar, svLastChar );
  2787.  *
  2788.  *  Purpose:  Sets svglobalReturnStr to be the string that is bound by 
  2789.  *            svFirstChar, svLastChar. Sets svglobalLineStr to the current line.
  2790.  *
  2791.  *    Input:  svFirstChar, svLastChar
  2792.  *
  2793.  *  Returns:
  2794.  *
  2795.  * Comments:  
  2796. \*---------------------------------------------------------------------------*/
  2797.  
  2798. function GetCurrentLine( svFirstChar, svLastChar )
  2799.  
  2800.    NUMBER    nvlocalFirstPos;
  2801.    NUMBER    nvlocalLastPos;
  2802.    NUMBER    nvStrLength;
  2803.  
  2804.     begin               
  2805.                    
  2806.         nvlocalFirstPos     = StrFind(svglobalLineStr, svFirstChar) + 1;
  2807.         nvlocalLastPos     = StrFind(svglobalLineStr, svLastChar);
  2808.         nvStrLength         = nvlocalLastPos - nvlocalFirstPos;
  2809.         StrSub(svglobalReturnStr, svglobalLineStr, nvlocalFirstPos, nvStrLength);   
  2810.        
  2811.     end;